Commit 4e7bc4d
authored
Responsive design | Breakpoints + TopBar (#72)
## What does this change?
Adds breakpoints to semantic tokens based on those from
[Figma](https://www.figma.com/design/gmHnKr3tOzvnYp1FZeIl4t/Stand--Editorial-tool-Design-System--WIP%F0%9F%9A%A7-?node-id=1-42&m=dev)
- `sm` -> 0 - 671px
- `md` -> 672px - 1055px
- `lg` -> 1056px - 1311px
- `xl` -> 1312px - 1583px
- `max` -> 1584px - 1783px
- `maxplus`-> 1784px+
These breakpoints will serve as the basis for responsive design, layout
and the grid system within stand and it's consuming applications.
We've added in utilities in `mq.ts` to help work with the breakpoint
system. Specifically a `from`, `until`, `between` methods used to create
css media queries based on a given breakpoint. A `useResize` callback
hook is also created to determine at runtime when a resize event
happens.
This PR also applies these to the `TopBar` component, thereby creating a
responsive `TopBar`.
We now collapse the items in the left hand side of the top bar at a
given breakpoint. See
[Figma](https://www.figma.com/design/gmHnKr3tOzvnYp1FZeIl4t/Stand--Editorial-tool-Design-System--WIP%F0%9F%9A%A7-?node-id=1746-8614&m=dev)
for designs.
The `TopBarToolName` has now been configured to only show the Favicon
when below the given `collapseBelow` prop, and added
`collapsedHoverText` for scenarios where we need a shorter hover text.
The `TopBarContainerLeft` items now collapse into a hamburger menu
automatically, with the items retaining similar syling as previous,
achieved by updating `TopBarItem` and `TopBarNavigation` to account for
menu open styles. The `TopBarContainerRight` never collapses, so a
developer should be careful about what goes there.
We also update `topBarContainerStyles` to account for which breakpoint
we should show/hide a given element/componet at.
The hamburger menu is implemented directly within the `TopBar` component
based on the [`Popover`](https://react-aria.adobe.com/Popover) component
and API.
https://github.com/user-attachments/assets/cdaa2fd0-3d1a-4cb5-972f-085f71578f63
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/121396733499400934 files changed
Lines changed: 1558 additions & 53 deletions
File tree
- .changeset
- src
- components/topbar
- topBarItem
- topBarToolName
- styleD
- build
- css
- component
- semantic
- typescript
- component
- semantic
- stories/semantic
- tokens
- component
- foundations
- utils/semantic
- util
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
| |||
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
118 | 156 | | |
119 | 157 | | |
120 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| 48 | + | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
| |||
84 | 87 | | |
85 | 88 | | |
86 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
87 | 138 | | |
88 | 139 | | |
89 | 140 | | |
| |||
116 | 167 | | |
117 | 168 | | |
118 | 169 | | |
| 170 | + | |
119 | 171 | | |
120 | 172 | | |
121 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
2 | 9 | | |
3 | 10 | | |
| 11 | + | |
4 | 12 | | |
| 13 | + | |
5 | 14 | | |
6 | 15 | | |
7 | 16 | | |
8 | | - | |
9 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
10 | 21 | | |
11 | 22 | | |
12 | 23 | | |
| |||
86 | 97 | | |
87 | 98 | | |
88 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
89 | 104 | | |
90 | 105 | | |
91 | 106 | | |
92 | 107 | | |
93 | 108 | | |
| 109 | + | |
| 110 | + | |
94 | 111 | | |
95 | 112 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
100 | 117 | | |
101 | 118 | | |
102 | 119 | | |
| |||
109 | 126 | | |
110 | 127 | | |
111 | 128 | | |
112 | | - | |
| 129 | + | |
113 | 130 | | |
114 | 131 | | |
115 | 132 | | |
116 | 133 | | |
117 | 134 | | |
118 | 135 | | |
119 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
120 | 141 | | |
121 | 142 | | |
122 | 143 | | |
| |||
141 | 162 | | |
142 | 163 | | |
143 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
144 | 208 | | |
145 | 209 | | |
146 | 210 | | |
147 | 211 | | |
148 | 212 | | |
149 | 213 | | |
150 | 214 | | |
151 | | - | |
152 | | - | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
153 | 256 | | |
154 | 257 | | |
155 | | - | |
156 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
157 | 265 | | |
158 | | - | |
159 | 266 | | |
| 267 | + | |
160 | 268 | | |
161 | 269 | | |
162 | 270 | | |
0 commit comments