@atom-learning/components 4.1.0 → 4.1.1
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.
- package/CHANGELOG.md +3 -8
- package/dist/components/top-bar/TopBar.d.ts +2 -371
- package/dist/components/top-bar/TopBar.js +1 -1
- package/dist/components/top-bar/TopBar.js.map +1 -1
- package/dist/docgen.json +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
## [4.1.1](https://github.com/Atom-Learning/components/compare/v4.1.0...v4.1.1) (2024-10-18)
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
###
|
|
5
|
-
|
|
6
|
-
* commintlint not working on code commits ([2570a3e](https://github.com/Atom-Learning/components/commit/2570a3ec30e6403cc6dc9f06996dc40b3a6992b1))
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### Features
|
|
4
|
+
### Reverts
|
|
10
5
|
|
|
11
|
-
*
|
|
6
|
+
* Revert "Merge pull request [#709](https://github.com/Atom-Learning/components/issues/709) from Atom-Learning/HMP-1179-ds-update-top-bar-tsx-and-allow-css-overrides" ([73293bc](https://github.com/Atom-Learning/components/commit/73293bc9d3aee4c62495f325eb3324292a5f41b6))
|
|
12
7
|
|
|
13
8
|
# [1.4.0](https://github.com/Atom-Learning/components/compare/v1.3.0...v1.4.0) (2022-04-11)
|
|
14
9
|
|
|
@@ -1,375 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CSS } from '../../stitches';
|
|
3
|
-
declare const StyledRoot: import("@atom-learning/stitches-react/types/styled-component").StyledComponent<
|
|
4
|
-
direction?: "inherit" | "initial" | "revert" | "unset" | "row" | "column" | "column-reverse" | "row-reverse" | "revert-layer" | undefined;
|
|
5
|
-
wrap?: "inherit" | "initial" | "revert" | "unset" | "wrap" | "nowrap" | "wrap-reverse" | "revert-layer" | undefined;
|
|
6
|
-
justify?: "left" | "right" | "center" | "stretch" | "inherit" | "initial" | "revert" | "unset" | "end" | "start" | "space-around" | "space-between" | "space-evenly" | "flex-end" | "flex-start" | "normal" | "revert-layer" | "unsafe" | "safe" | undefined;
|
|
7
|
-
align?: "center" | "stretch" | "inherit" | "initial" | "revert" | "unset" | "end" | "start" | "flex-end" | "flex-start" | "baseline" | "normal" | "self-end" | "self-start" | "revert-layer" | "unsafe" | "safe" | "first baseline" | "last baseline" | undefined;
|
|
8
|
-
gap?: number | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "24" | undefined;
|
|
9
|
-
}, {
|
|
10
|
-
sm: string;
|
|
11
|
-
md: string;
|
|
12
|
-
lg: string;
|
|
13
|
-
xl: string;
|
|
14
|
-
reducedMotion: string;
|
|
15
|
-
allowMotion: string;
|
|
16
|
-
hover: string;
|
|
17
|
-
}, import("@atom-learning/stitches-react/types/css-util").CSS<{
|
|
18
|
-
sm: string;
|
|
19
|
-
md: string;
|
|
20
|
-
lg: string;
|
|
21
|
-
xl: string;
|
|
22
|
-
reducedMotion: string;
|
|
23
|
-
allowMotion: string;
|
|
24
|
-
hover: string;
|
|
25
|
-
}, {
|
|
26
|
-
colors: {
|
|
27
|
-
textBold: string;
|
|
28
|
-
textRegular: string;
|
|
29
|
-
textSubtle: string;
|
|
30
|
-
textMinimal: string;
|
|
31
|
-
background: string;
|
|
32
|
-
backgroundAccent: string;
|
|
33
|
-
grey100: string;
|
|
34
|
-
grey200: string;
|
|
35
|
-
grey300: string;
|
|
36
|
-
grey400: string;
|
|
37
|
-
grey500: string;
|
|
38
|
-
grey600: string;
|
|
39
|
-
grey700: string;
|
|
40
|
-
grey800: string;
|
|
41
|
-
grey900: string;
|
|
42
|
-
grey1000: string;
|
|
43
|
-
grey1100: string;
|
|
44
|
-
grey1200: string;
|
|
45
|
-
blue100: string;
|
|
46
|
-
blue200: string;
|
|
47
|
-
blue300: string;
|
|
48
|
-
blue400: string;
|
|
49
|
-
blue500: string;
|
|
50
|
-
blue600: string;
|
|
51
|
-
blue700: string;
|
|
52
|
-
blue800: string;
|
|
53
|
-
blue900: string;
|
|
54
|
-
blue1000: string;
|
|
55
|
-
blue1100: string;
|
|
56
|
-
blue1200: string;
|
|
57
|
-
pink100: string;
|
|
58
|
-
pink200: string;
|
|
59
|
-
pink300: string;
|
|
60
|
-
pink400: string;
|
|
61
|
-
pink500: string;
|
|
62
|
-
pink600: string;
|
|
63
|
-
pink700: string;
|
|
64
|
-
pink800: string;
|
|
65
|
-
pink900: string;
|
|
66
|
-
pink1000: string;
|
|
67
|
-
pink1100: string;
|
|
68
|
-
pink1200: string;
|
|
69
|
-
purple100: string;
|
|
70
|
-
purple200: string;
|
|
71
|
-
purple300: string;
|
|
72
|
-
purple400: string;
|
|
73
|
-
purple500: string;
|
|
74
|
-
purple600: string;
|
|
75
|
-
purple700: string;
|
|
76
|
-
purple800: string;
|
|
77
|
-
purple900: string;
|
|
78
|
-
purple1000: string;
|
|
79
|
-
purple1100: string;
|
|
80
|
-
purple1200: string;
|
|
81
|
-
cyan100: string;
|
|
82
|
-
cyan200: string;
|
|
83
|
-
cyan300: string;
|
|
84
|
-
cyan400: string;
|
|
85
|
-
cyan500: string;
|
|
86
|
-
cyan600: string;
|
|
87
|
-
cyan700: string;
|
|
88
|
-
cyan800: string;
|
|
89
|
-
cyan900: string;
|
|
90
|
-
cyan1000: string;
|
|
91
|
-
cyan1100: string;
|
|
92
|
-
cyan1200: string;
|
|
93
|
-
green100: string;
|
|
94
|
-
green200: string;
|
|
95
|
-
green300: string;
|
|
96
|
-
green400: string;
|
|
97
|
-
green500: string;
|
|
98
|
-
green600: string;
|
|
99
|
-
green700: string;
|
|
100
|
-
green800: string;
|
|
101
|
-
green900: string;
|
|
102
|
-
green1000: string;
|
|
103
|
-
green1100: string;
|
|
104
|
-
green1200: string;
|
|
105
|
-
magenta100: string;
|
|
106
|
-
magenta200: string;
|
|
107
|
-
magenta300: string;
|
|
108
|
-
magenta400: string;
|
|
109
|
-
magenta500: string;
|
|
110
|
-
magenta600: string;
|
|
111
|
-
magenta700: string;
|
|
112
|
-
magenta800: string;
|
|
113
|
-
magenta900: string;
|
|
114
|
-
magenta1000: string;
|
|
115
|
-
magenta1100: string;
|
|
116
|
-
magenta1200: string;
|
|
117
|
-
red100: string;
|
|
118
|
-
red200: string;
|
|
119
|
-
red300: string;
|
|
120
|
-
red400: string;
|
|
121
|
-
red500: string;
|
|
122
|
-
red600: string;
|
|
123
|
-
red700: string;
|
|
124
|
-
red800: string;
|
|
125
|
-
red900: string;
|
|
126
|
-
red1000: string;
|
|
127
|
-
red1100: string;
|
|
128
|
-
red1200: string;
|
|
129
|
-
teal100: string;
|
|
130
|
-
teal200: string;
|
|
131
|
-
teal300: string;
|
|
132
|
-
teal400: string;
|
|
133
|
-
teal500: string;
|
|
134
|
-
teal600: string;
|
|
135
|
-
teal700: string;
|
|
136
|
-
teal800: string;
|
|
137
|
-
teal900: string;
|
|
138
|
-
teal1000: string;
|
|
139
|
-
teal1100: string;
|
|
140
|
-
teal1200: string;
|
|
141
|
-
orange100: string;
|
|
142
|
-
orange200: string;
|
|
143
|
-
orange300: string;
|
|
144
|
-
orange400: string;
|
|
145
|
-
orange500: string;
|
|
146
|
-
orange600: string;
|
|
147
|
-
orange700: string;
|
|
148
|
-
orange800: string;
|
|
149
|
-
orange900: string;
|
|
150
|
-
orange1000: string;
|
|
151
|
-
orange1100: string;
|
|
152
|
-
orange1200: string;
|
|
153
|
-
yellow100: string;
|
|
154
|
-
yellow200: string;
|
|
155
|
-
yellow300: string;
|
|
156
|
-
yellow400: string;
|
|
157
|
-
yellow500: string;
|
|
158
|
-
yellow600: string;
|
|
159
|
-
yellow700: string;
|
|
160
|
-
yellow800: string;
|
|
161
|
-
yellow900: string;
|
|
162
|
-
yellow1000: string;
|
|
163
|
-
yellow1100: string;
|
|
164
|
-
yellow1200: string;
|
|
165
|
-
lime100: string;
|
|
166
|
-
lime200: string;
|
|
167
|
-
lime300: string;
|
|
168
|
-
lime400: string;
|
|
169
|
-
lime500: string;
|
|
170
|
-
lime600: string;
|
|
171
|
-
lime700: string;
|
|
172
|
-
lime800: string;
|
|
173
|
-
lime900: string;
|
|
174
|
-
lime1000: string;
|
|
175
|
-
lime1100: string;
|
|
176
|
-
lime1200: string;
|
|
177
|
-
lapis100: string;
|
|
178
|
-
lapis200: string;
|
|
179
|
-
lapis300: string;
|
|
180
|
-
lapis400: string;
|
|
181
|
-
lapis500: string;
|
|
182
|
-
lapis600: string;
|
|
183
|
-
lapis700: string;
|
|
184
|
-
lapis800: string;
|
|
185
|
-
lapis900: string;
|
|
186
|
-
lapis1000: string;
|
|
187
|
-
lapis1100: string;
|
|
188
|
-
lapis1200: string;
|
|
189
|
-
maroon100: string;
|
|
190
|
-
maroon200: string;
|
|
191
|
-
maroon300: string;
|
|
192
|
-
maroon400: string;
|
|
193
|
-
maroon500: string;
|
|
194
|
-
maroon600: string;
|
|
195
|
-
maroon700: string;
|
|
196
|
-
maroon800: string;
|
|
197
|
-
maroon900: string;
|
|
198
|
-
maroon1000: string;
|
|
199
|
-
maroon1100: string;
|
|
200
|
-
maroon1200: string;
|
|
201
|
-
marsh100: string;
|
|
202
|
-
marsh200: string;
|
|
203
|
-
marsh300: string;
|
|
204
|
-
marsh400: string;
|
|
205
|
-
marsh500: string;
|
|
206
|
-
marsh600: string;
|
|
207
|
-
marsh700: string;
|
|
208
|
-
marsh800: string;
|
|
209
|
-
marsh900: string;
|
|
210
|
-
marsh1000: string;
|
|
211
|
-
marsh1100: string;
|
|
212
|
-
marsh1200: string;
|
|
213
|
-
alpha100: string;
|
|
214
|
-
alpha150: string;
|
|
215
|
-
alpha200: string;
|
|
216
|
-
alpha250: string;
|
|
217
|
-
alpha600: string;
|
|
218
|
-
infoLight: string;
|
|
219
|
-
info: string;
|
|
220
|
-
infoMid: string;
|
|
221
|
-
infoDark: string;
|
|
222
|
-
successLight: string;
|
|
223
|
-
success: string;
|
|
224
|
-
successMid: string;
|
|
225
|
-
successDark: string;
|
|
226
|
-
dangerLight: string;
|
|
227
|
-
danger: string;
|
|
228
|
-
dangerMid: string;
|
|
229
|
-
dangerDark: string;
|
|
230
|
-
warningLight: string;
|
|
231
|
-
warning: string;
|
|
232
|
-
warningMid: string;
|
|
233
|
-
warningDark: string;
|
|
234
|
-
warningText: string;
|
|
235
|
-
subjectEnglish: string;
|
|
236
|
-
subjectMaths: string;
|
|
237
|
-
subjectScience: string;
|
|
238
|
-
subjectVerbalReasoning: string;
|
|
239
|
-
subjectNonVerbalReasoning: string;
|
|
240
|
-
subjectCreativeWriting: string;
|
|
241
|
-
subjectExamSkills: string;
|
|
242
|
-
glBlueLight: string;
|
|
243
|
-
glBluePrimary: string;
|
|
244
|
-
glBlueDark: string;
|
|
245
|
-
primary100: string;
|
|
246
|
-
primary200: string;
|
|
247
|
-
primary300: string;
|
|
248
|
-
primary400: string;
|
|
249
|
-
primary500: string;
|
|
250
|
-
primary600: string;
|
|
251
|
-
primary700: string;
|
|
252
|
-
primary800: string;
|
|
253
|
-
primary900: string;
|
|
254
|
-
primary1000: string;
|
|
255
|
-
primary1100: string;
|
|
256
|
-
primary1200: string;
|
|
257
|
-
};
|
|
258
|
-
space: {
|
|
259
|
-
"0": string;
|
|
260
|
-
"1": string;
|
|
261
|
-
"2": string;
|
|
262
|
-
"3": string;
|
|
263
|
-
"4": string;
|
|
264
|
-
"5": string;
|
|
265
|
-
"6": string;
|
|
266
|
-
"7": string;
|
|
267
|
-
"8": string;
|
|
268
|
-
"9": string;
|
|
269
|
-
"24": string;
|
|
270
|
-
};
|
|
271
|
-
fontSizes: {
|
|
272
|
-
xs: string;
|
|
273
|
-
sm: string;
|
|
274
|
-
md: string;
|
|
275
|
-
lg: string;
|
|
276
|
-
xl: string;
|
|
277
|
-
"2xl": string;
|
|
278
|
-
"3xl": string;
|
|
279
|
-
"4xl": string;
|
|
280
|
-
};
|
|
281
|
-
fonts: {
|
|
282
|
-
sans: string;
|
|
283
|
-
mono: string;
|
|
284
|
-
display: string;
|
|
285
|
-
body: string;
|
|
286
|
-
};
|
|
287
|
-
sizes: {
|
|
288
|
-
"0": string;
|
|
289
|
-
"1": string;
|
|
290
|
-
"2": string;
|
|
291
|
-
"3": string;
|
|
292
|
-
"4": string;
|
|
293
|
-
"5": string;
|
|
294
|
-
"6": string;
|
|
295
|
-
"7": string;
|
|
296
|
-
"8": string;
|
|
297
|
-
};
|
|
298
|
-
radii: {
|
|
299
|
-
"0": string;
|
|
300
|
-
"1": string;
|
|
301
|
-
"2": string;
|
|
302
|
-
"3": string;
|
|
303
|
-
round: string;
|
|
304
|
-
};
|
|
305
|
-
shadows: {
|
|
306
|
-
"0": string;
|
|
307
|
-
"1": string;
|
|
308
|
-
"2": string;
|
|
309
|
-
"3": string;
|
|
310
|
-
};
|
|
311
|
-
ratios: {
|
|
312
|
-
"16-9": string;
|
|
313
|
-
"3-2": string;
|
|
314
|
-
"4-3": string;
|
|
315
|
-
"1-1": string;
|
|
316
|
-
"3-4": string;
|
|
317
|
-
};
|
|
318
|
-
}, import("@atom-learning/stitches-react/types/config").DefaultThemeMap, {
|
|
319
|
-
bg: (value: import("@atom-learning/stitches-react").PropertyValue<"background">) => {
|
|
320
|
-
background: import("@atom-learning/stitches-react/types/css-util").WithPropertyValue<"background">;
|
|
321
|
-
};
|
|
322
|
-
size: (value: import("@atom-learning/stitches-react").ScaleValue<"size"> | number | string) => {
|
|
323
|
-
height: string | number | import("@atom-learning/stitches-react/types/css-util").WithScaleValue<"size">;
|
|
324
|
-
width: string | number | import("@atom-learning/stitches-react/types/css-util").WithScaleValue<"size">;
|
|
325
|
-
};
|
|
326
|
-
p: (value: import("@atom-learning/stitches-react").ScaleValue<"space"> | number | string) => {
|
|
327
|
-
padding: string | number | import("@atom-learning/stitches-react/types/css-util").WithScaleValue<"space">;
|
|
328
|
-
};
|
|
329
|
-
pt: (value: import("@atom-learning/stitches-react").ScaleValue<"space"> | number | string) => {
|
|
330
|
-
paddingTop: string | number | import("@atom-learning/stitches-react/types/css-util").WithScaleValue<"space">;
|
|
331
|
-
};
|
|
332
|
-
pr: (value: import("@atom-learning/stitches-react").ScaleValue<"space"> | number | string) => {
|
|
333
|
-
paddingRight: string | number | import("@atom-learning/stitches-react/types/css-util").WithScaleValue<"space">;
|
|
334
|
-
};
|
|
335
|
-
pb: (value: import("@atom-learning/stitches-react").ScaleValue<"space"> | number | string) => {
|
|
336
|
-
paddingBottom: string | number | import("@atom-learning/stitches-react/types/css-util").WithScaleValue<"space">;
|
|
337
|
-
};
|
|
338
|
-
pl: (value: import("@atom-learning/stitches-react").ScaleValue<"space"> | number | string) => {
|
|
339
|
-
paddingLeft: string | number | import("@atom-learning/stitches-react/types/css-util").WithScaleValue<"space">;
|
|
340
|
-
};
|
|
341
|
-
px: (value: import("@atom-learning/stitches-react").ScaleValue<"space"> | number | string) => {
|
|
342
|
-
paddingLeft: string | number | import("@atom-learning/stitches-react/types/css-util").WithScaleValue<"space">;
|
|
343
|
-
paddingRight: string | number | import("@atom-learning/stitches-react/types/css-util").WithScaleValue<"space">;
|
|
344
|
-
};
|
|
345
|
-
py: (value: import("@atom-learning/stitches-react").ScaleValue<"space"> | number | string) => {
|
|
346
|
-
paddingTop: string | number | import("@atom-learning/stitches-react/types/css-util").WithScaleValue<"space">;
|
|
347
|
-
paddingBottom: string | number | import("@atom-learning/stitches-react/types/css-util").WithScaleValue<"space">;
|
|
348
|
-
};
|
|
349
|
-
m: (value: import("@atom-learning/stitches-react").ScaleValue<"space"> | number | string) => {
|
|
350
|
-
margin: string | number | import("@atom-learning/stitches-react/types/css-util").WithScaleValue<"space">;
|
|
351
|
-
};
|
|
352
|
-
mt: (value: import("@atom-learning/stitches-react").ScaleValue<"space"> | number | string) => {
|
|
353
|
-
marginTop: string | number | import("@atom-learning/stitches-react/types/css-util").WithScaleValue<"space">;
|
|
354
|
-
};
|
|
355
|
-
mr: (value: import("@atom-learning/stitches-react").ScaleValue<"space"> | number | string) => {
|
|
356
|
-
marginRight: string | number | import("@atom-learning/stitches-react/types/css-util").WithScaleValue<"space">;
|
|
357
|
-
};
|
|
358
|
-
mb: (value: import("@atom-learning/stitches-react").ScaleValue<"space"> | number | string) => {
|
|
359
|
-
marginBottom: string | number | import("@atom-learning/stitches-react/types/css-util").WithScaleValue<"space">;
|
|
360
|
-
};
|
|
361
|
-
ml: (value: import("@atom-learning/stitches-react").ScaleValue<"space"> | number | string) => {
|
|
362
|
-
marginLeft: string | number | import("@atom-learning/stitches-react/types/css-util").WithScaleValue<"space">;
|
|
363
|
-
};
|
|
364
|
-
mx: (value: import("@atom-learning/stitches-react").ScaleValue<"space"> | number | string) => {
|
|
365
|
-
marginLeft: string | number | import("@atom-learning/stitches-react/types/css-util").WithScaleValue<"space">;
|
|
366
|
-
marginRight: string | number | import("@atom-learning/stitches-react/types/css-util").WithScaleValue<"space">;
|
|
367
|
-
};
|
|
368
|
-
my: (value: import("@atom-learning/stitches-react").ScaleValue<"space"> | number | string) => {
|
|
369
|
-
marginTop: string | number | import("@atom-learning/stitches-react/types/css-util").WithScaleValue<"space">;
|
|
370
|
-
marginBottom: string | number | import("@atom-learning/stitches-react/types/css-util").WithScaleValue<"space">;
|
|
371
|
-
};
|
|
372
|
-
}>>, {
|
|
3
|
+
declare const StyledRoot: import("@atom-learning/stitches-react/types/styled-component").StyledComponent<"div", {
|
|
373
4
|
hasScrolled?: boolean | "true" | undefined;
|
|
374
5
|
size?: "md" | "lg" | undefined;
|
|
375
6
|
}, {
|
|
@@ -742,7 +373,7 @@ interface TopBarProps extends StyledRootProps {
|
|
|
742
373
|
className?: string;
|
|
743
374
|
}
|
|
744
375
|
export declare const TopBar: {
|
|
745
|
-
({ className, ...props }: TopBarProps): React.JSX.Element;
|
|
376
|
+
({ size, className, ...props }: TopBarProps): React.JSX.Element;
|
|
746
377
|
displayName: string;
|
|
747
378
|
} & {
|
|
748
379
|
Brand: import("@atom-learning/stitches-react/types/styled-component").StyledComponent<"a", {}, {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o from"react";import{styled as
|
|
1
|
+
import o from"react";import{styled as e}from"../../stitches.js";import{useWindowScrollPosition as n}from"../../utilities/hooks/useWindowScrollPosition.js";import{Divider as s}from"../divider/Divider.js";import{Flex as d}from"../flex/Flex.js";import{colorSchemes as c}from"./stitches.topBar.colorscheme.config.js";import{TopBarActionIcon as l}from"./TopBarActionIcon.js";import{TopBarBrand as p,TopBarBrandLogo as g,TopBarBrandName as h}from"./TopBarBrand.js";const x=()=>o.createElement(s,{orientation:"vertical",css:{height:"$2",bg:"$divider"}}),B=e("div",{bg:"$background",position:"sticky",display:"flex",alignItems:"center",width:"100vw",top:"0",zIndex:1,borderBottom:"1px solid $borderBottom",transition:"box-shadow .2s ease-out",variants:{hasScrolled:{true:{boxShadow:"0px 4px 4px -2px rgba(31, 31, 31, 0.1);"}},size:{md:{height:"$6"},lg:{height:"$7"}}}}),f=e(d,{alignItems:"center",height:"$4",mx:"$4",width:"100%","@md":{mx:"$5"}}),r=({size:t="md",className:i=c.light,...a})=>{const{y:m}=n();return o.createElement(B,{className:i,hasScrolled:!!m,size:t},o.createElement(f,{...a}))},b=Object.assign(r,{Brand:p,BrandLogo:g,BrandName:h,ActionIcon:l,Divider:x});r.displayName="TopBar";export{b as TopBar};
|
|
2
2
|
//# sourceMappingURL=TopBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopBar.js","sources":["../../../src/components/top-bar/TopBar.tsx"],"sourcesContent":["import React from 'react'\n\nimport { CSS, styled } from '~/stitches'\nimport { useWindowScrollPosition } from '~/utilities/hooks/useWindowScrollPosition'\n\nimport { Divider } from '../divider'\nimport { Flex } from '../flex'\nimport { colorSchemes as topBarColorSchemes } from './stitches.topBar.colorscheme.config'\nimport { TopBarActionIcon } from './TopBarActionIcon'\nimport { TopBarBrand, TopBarBrandLogo, TopBarBrandName } from './TopBarBrand'\n\nconst TopBarDivider = () => (\n <Divider orientation=\"vertical\" css={{ height: '$2', bg: '$divider' }} />\n)\n\nconst StyledRoot = styled(
|
|
1
|
+
{"version":3,"file":"TopBar.js","sources":["../../../src/components/top-bar/TopBar.tsx"],"sourcesContent":["import React from 'react'\n\nimport { CSS, styled } from '~/stitches'\nimport { useWindowScrollPosition } from '~/utilities/hooks/useWindowScrollPosition'\n\nimport { Divider } from '../divider'\nimport { Flex } from '../flex'\nimport { colorSchemes as topBarColorSchemes } from './stitches.topBar.colorscheme.config'\nimport { TopBarActionIcon } from './TopBarActionIcon'\nimport { TopBarBrand, TopBarBrandLogo, TopBarBrandName } from './TopBarBrand'\n\nconst TopBarDivider = () => (\n <Divider orientation=\"vertical\" css={{ height: '$2', bg: '$divider' }} />\n)\n\nconst StyledRoot = styled('div', {\n bg: '$background',\n position: 'sticky',\n display: 'flex',\n alignItems: 'center',\n width: '100vw',\n top: '0',\n zIndex: 1,\n borderBottom: '1px solid $borderBottom',\n transition: 'box-shadow .2s ease-out',\n variants: {\n hasScrolled: {\n true: { boxShadow: '0px 4px 4px -2px rgba(31, 31, 31, 0.1);' }\n },\n size: {\n md: { height: '$6' },\n lg: { height: '$7' }\n }\n }\n})\n\nconst Container = styled(Flex, {\n alignItems: 'center',\n height: '$4',\n mx: '$4',\n width: '100%',\n '@md': {\n mx: '$5'\n }\n})\n\ntype StyledRootProps = React.ComponentProps<typeof StyledRoot>\n\ninterface TopBarProps extends StyledRootProps {\n css?: CSS\n className?: string\n}\n\nconst TopBarComponent = ({\n size = 'md',\n className = topBarColorSchemes['light'],\n ...props\n}: TopBarProps) => {\n const { y: scrollPositionY } = useWindowScrollPosition()\n\n return (\n <StyledRoot\n className={className}\n hasScrolled={!!scrollPositionY}\n size={size}\n >\n <Container {...props} />\n </StyledRoot>\n )\n}\n\nexport const TopBar = Object.assign(TopBarComponent, {\n Brand: TopBarBrand,\n BrandLogo: TopBarBrandLogo,\n BrandName: TopBarBrandName,\n ActionIcon: TopBarActionIcon,\n Divider: TopBarDivider\n})\n\nTopBarComponent.displayName = 'TopBar'\n"],"names":["TopBarDivider","React","Divider","StyledRoot","styled","Container","Flex","TopBarComponent","size","className","topBarColorSchemes","props","scrollPositionY","useWindowScrollPosition","TopBar","TopBarBrand","TopBarBrandLogo","TopBarBrandName","TopBarActionIcon"],"mappings":"2cAWA,MAAMA,EAAgB,IACpBC,EAAA,cAACC,EAAA,CAAQ,YAAY,WAAW,IAAK,CAAE,OAAQ,KAAM,GAAI,UAAW,CAAG,CAAA,EAGnEC,EAAaC,EAAO,MAAO,CAC/B,GAAI,cACJ,SAAU,SACV,QAAS,OACT,WAAY,SACZ,MAAO,QACP,IAAK,IACL,OAAQ,EACR,aAAc,0BACd,WAAY,0BACZ,SAAU,CACR,YAAa,CACX,KAAM,CAAE,UAAW,yCAA0C,CAC/D,EACA,KAAM,CACJ,GAAI,CAAE,OAAQ,IAAK,EACnB,GAAI,CAAE,OAAQ,IAAK,CACrB,CACF,CACF,CAAC,EAEKC,EAAYD,EAAOE,EAAM,CAC7B,WAAY,SACZ,OAAQ,KACR,GAAI,KACJ,MAAO,OACP,MAAO,CACL,GAAI,IACN,CACF,CAAC,EASKC,EAAkB,CAAC,CACvB,KAAAC,EAAO,KACP,UAAAC,EAAYC,EAAmB,SAC5BC,CACL,IAAmB,CACjB,KAAM,CAAE,EAAGC,CAAgB,EAAIC,EAAAA,EAE/B,OACEZ,EAAA,cAACE,EAAA,CACC,UAAWM,EACX,YAAa,CAAC,CAACG,EACf,KAAMJ,CAENP,EAAAA,EAAA,cAACI,EAAA,CAAW,GAAGM,CAAO,CAAA,CACxB,CAEJ,EAEaG,EAAS,OAAO,OAAOP,EAAiB,CACnD,MAAOQ,EACP,UAAWC,EACX,UAAWC,EACX,WAAYC,EACZ,QAASlB,CACX,CAAC,EAEDO,EAAgB,YAAc"}
|