@atom-learning/components 2.4.1 → 2.5.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.
- package/CHANGELOG.md +10 -2
- package/dist/components/top-bar/TopBar.d.ts +271 -1
- package/dist/components/top-bar/TopBar.js +1 -1
- package/dist/components/top-bar/TopBarBrand.d.ts +4 -1
- package/dist/components/top-bar/TopBarBrand.js +1 -1
- package/dist/docgen.json +1 -1
- package/dist/docs/EmptyState.mdx +1 -1
- package/dist/docs/TopBar.mdx +22 -0
- package/dist/index.cjs.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
# [2.5.0](https://github.com/Atom-Learning/components/compare/v2.4.1...v2.5.0) (2022-09-29)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* **TopBar:** add size variant ([b591220](https://github.com/Atom-Learning/components/commit/b591220ab07f8c87403207cbaad066eef9b0e983))
|
|
7
|
+
* **TopBar:** update snapshots ([13ef6db](https://github.com/Atom-Learning/components/commit/13ef6dbef2ab79ec12258a3b8ce4ad4fc507ba6b))
|
|
8
|
+
* **TopBar:** update tests and TopBar components ([15cc7b1](https://github.com/Atom-Learning/components/commit/15cc7b148dab0444fc30ae71644ebc97f84e9677))
|
|
9
|
+
* **TopBar:** update TopBar tests ([7f10d49](https://github.com/Atom-Learning/components/commit/7f10d495d4e62466b6528b0cf27e87179072c716))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* **TopBar:** update TopBar Docs ([7037d69](https://github.com/Atom-Learning/components/commit/7037d69ba147ebc1bdfc6e47c1ffe748b7714033))
|
|
7
15
|
|
|
8
16
|
# [1.4.0](https://github.com/Atom-Learning/components/compare/v1.3.0...v1.4.0) (2022-04-11)
|
|
9
17
|
|
|
@@ -10,7 +10,277 @@ interface TopBarSubComponents {
|
|
|
10
10
|
Divider: typeof TopBarDivider;
|
|
11
11
|
}
|
|
12
12
|
declare const TopBarDivider: () => JSX.Element;
|
|
13
|
-
|
|
13
|
+
declare const StyledRoot: import("@stitches/react/types/styled-component").StyledComponent<"div", {
|
|
14
|
+
hasScrolled?: boolean | "true" | undefined;
|
|
15
|
+
size?: "md" | "lg" | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
sm: string;
|
|
18
|
+
md: string;
|
|
19
|
+
lg: string;
|
|
20
|
+
xl: string;
|
|
21
|
+
reducedMotion: string;
|
|
22
|
+
allowMotion: string;
|
|
23
|
+
hover: string;
|
|
24
|
+
}, import("@stitches/react/types/css-util").CSS<{
|
|
25
|
+
sm: string;
|
|
26
|
+
md: string;
|
|
27
|
+
lg: string;
|
|
28
|
+
xl: string;
|
|
29
|
+
reducedMotion: string;
|
|
30
|
+
allowMotion: string;
|
|
31
|
+
hover: string;
|
|
32
|
+
}, {
|
|
33
|
+
colors: {
|
|
34
|
+
textForeground: any;
|
|
35
|
+
textSubtle: any;
|
|
36
|
+
textPlaceholder: any;
|
|
37
|
+
background: any;
|
|
38
|
+
backgroundAccent: any;
|
|
39
|
+
tonal50: any;
|
|
40
|
+
tonal100: any;
|
|
41
|
+
tonal200: any;
|
|
42
|
+
tonal300: any;
|
|
43
|
+
tonal400: any;
|
|
44
|
+
tonal500: any;
|
|
45
|
+
tonal600: any;
|
|
46
|
+
alpha100: any;
|
|
47
|
+
alpha150: any;
|
|
48
|
+
alpha200: any;
|
|
49
|
+
alpha250: any;
|
|
50
|
+
alpha600: any;
|
|
51
|
+
primaryLight: any;
|
|
52
|
+
primary: any;
|
|
53
|
+
primaryMid: any;
|
|
54
|
+
primaryDark: any;
|
|
55
|
+
secondary: any;
|
|
56
|
+
brandRed: any;
|
|
57
|
+
brandRedAccent: any;
|
|
58
|
+
brandGreen: any;
|
|
59
|
+
brandGreenAccent: any;
|
|
60
|
+
brandPurple: any;
|
|
61
|
+
brandPurpleAccent: any;
|
|
62
|
+
brandYellow: any;
|
|
63
|
+
brandYellowAccent: any;
|
|
64
|
+
successLight: any;
|
|
65
|
+
success: any;
|
|
66
|
+
successMid: any;
|
|
67
|
+
successDark: any;
|
|
68
|
+
dangerLight: any;
|
|
69
|
+
danger: any;
|
|
70
|
+
dangerMid: any;
|
|
71
|
+
dangerDark: any;
|
|
72
|
+
warningLight: any;
|
|
73
|
+
warning: any;
|
|
74
|
+
warningMid: any;
|
|
75
|
+
warningDark: any;
|
|
76
|
+
warningText: any;
|
|
77
|
+
subjectEnglish: any;
|
|
78
|
+
subjectMaths: any;
|
|
79
|
+
subjectScience: any;
|
|
80
|
+
subjectVerbalReasoning: any;
|
|
81
|
+
subjectNonVerbalReasoning: any;
|
|
82
|
+
subjectCreativeWriting: any;
|
|
83
|
+
subjectExamSkills: any;
|
|
84
|
+
};
|
|
85
|
+
space: {
|
|
86
|
+
"0": any;
|
|
87
|
+
"1": any;
|
|
88
|
+
"2": any;
|
|
89
|
+
"3": any;
|
|
90
|
+
"4": any;
|
|
91
|
+
"5": any;
|
|
92
|
+
"6": any;
|
|
93
|
+
"7": any;
|
|
94
|
+
"8": any;
|
|
95
|
+
"9": any;
|
|
96
|
+
};
|
|
97
|
+
fontSizes: {
|
|
98
|
+
xs: any;
|
|
99
|
+
sm: any;
|
|
100
|
+
md: any;
|
|
101
|
+
lg: any;
|
|
102
|
+
xl: any;
|
|
103
|
+
"2xl": any;
|
|
104
|
+
"3xl": any;
|
|
105
|
+
"4xl": any;
|
|
106
|
+
};
|
|
107
|
+
fonts: {
|
|
108
|
+
sans: any;
|
|
109
|
+
mono: any;
|
|
110
|
+
display: any;
|
|
111
|
+
body: any;
|
|
112
|
+
};
|
|
113
|
+
sizes: {
|
|
114
|
+
"0": any;
|
|
115
|
+
"1": any;
|
|
116
|
+
"2": any;
|
|
117
|
+
"3": any;
|
|
118
|
+
"4": any;
|
|
119
|
+
"5": any;
|
|
120
|
+
"6": any;
|
|
121
|
+
"7": any;
|
|
122
|
+
"8": any;
|
|
123
|
+
};
|
|
124
|
+
radii: {
|
|
125
|
+
"0": any;
|
|
126
|
+
"1": any;
|
|
127
|
+
"2": any;
|
|
128
|
+
"3": any;
|
|
129
|
+
round: any;
|
|
130
|
+
};
|
|
131
|
+
shadows: {
|
|
132
|
+
"0": any;
|
|
133
|
+
"1": any;
|
|
134
|
+
"2": any;
|
|
135
|
+
"3": any;
|
|
136
|
+
};
|
|
137
|
+
}, import("@stitches/react/types/config").DefaultThemeMap, {
|
|
138
|
+
bg: (value: {
|
|
139
|
+
readonly [$$PropertyValue]: "background";
|
|
140
|
+
}) => {
|
|
141
|
+
background: {
|
|
142
|
+
readonly [$$PropertyValue]: "background";
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
inset: (value: string | number | {
|
|
146
|
+
readonly [$$ScaleValue]: "space";
|
|
147
|
+
}) => {
|
|
148
|
+
top: string | number | {
|
|
149
|
+
readonly [$$ScaleValue]: "space";
|
|
150
|
+
};
|
|
151
|
+
right: string | number | {
|
|
152
|
+
readonly [$$ScaleValue]: "space";
|
|
153
|
+
};
|
|
154
|
+
bottom: string | number | {
|
|
155
|
+
readonly [$$ScaleValue]: "space";
|
|
156
|
+
};
|
|
157
|
+
left: string | number | {
|
|
158
|
+
readonly [$$ScaleValue]: "space";
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
size: (value: string | number | {
|
|
162
|
+
readonly [$$ScaleValue]: "size";
|
|
163
|
+
}) => {
|
|
164
|
+
height: string | number | {
|
|
165
|
+
readonly [$$ScaleValue]: "size";
|
|
166
|
+
};
|
|
167
|
+
width: string | number | {
|
|
168
|
+
readonly [$$ScaleValue]: "size";
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
p: (value: string | number | {
|
|
172
|
+
readonly [$$ScaleValue]: "space";
|
|
173
|
+
}) => {
|
|
174
|
+
padding: string | number | {
|
|
175
|
+
readonly [$$ScaleValue]: "space";
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
pt: (value: string | number | {
|
|
179
|
+
readonly [$$ScaleValue]: "space";
|
|
180
|
+
}) => {
|
|
181
|
+
paddingTop: string | number | {
|
|
182
|
+
readonly [$$ScaleValue]: "space";
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
pr: (value: string | number | {
|
|
186
|
+
readonly [$$ScaleValue]: "space";
|
|
187
|
+
}) => {
|
|
188
|
+
paddingRight: string | number | {
|
|
189
|
+
readonly [$$ScaleValue]: "space";
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
pb: (value: string | number | {
|
|
193
|
+
readonly [$$ScaleValue]: "space";
|
|
194
|
+
}) => {
|
|
195
|
+
paddingBottom: string | number | {
|
|
196
|
+
readonly [$$ScaleValue]: "space";
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
pl: (value: string | number | {
|
|
200
|
+
readonly [$$ScaleValue]: "space";
|
|
201
|
+
}) => {
|
|
202
|
+
paddingLeft: string | number | {
|
|
203
|
+
readonly [$$ScaleValue]: "space";
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
px: (value: string | number | {
|
|
207
|
+
readonly [$$ScaleValue]: "space";
|
|
208
|
+
}) => {
|
|
209
|
+
paddingLeft: string | number | {
|
|
210
|
+
readonly [$$ScaleValue]: "space";
|
|
211
|
+
};
|
|
212
|
+
paddingRight: string | number | {
|
|
213
|
+
readonly [$$ScaleValue]: "space";
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
py: (value: string | number | {
|
|
217
|
+
readonly [$$ScaleValue]: "space";
|
|
218
|
+
}) => {
|
|
219
|
+
paddingTop: string | number | {
|
|
220
|
+
readonly [$$ScaleValue]: "space";
|
|
221
|
+
};
|
|
222
|
+
paddingBottom: string | number | {
|
|
223
|
+
readonly [$$ScaleValue]: "space";
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
m: (value: string | number | {
|
|
227
|
+
readonly [$$ScaleValue]: "space";
|
|
228
|
+
}) => {
|
|
229
|
+
margin: string | number | {
|
|
230
|
+
readonly [$$ScaleValue]: "space";
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
mt: (value: string | number | {
|
|
234
|
+
readonly [$$ScaleValue]: "space";
|
|
235
|
+
}) => {
|
|
236
|
+
marginTop: string | number | {
|
|
237
|
+
readonly [$$ScaleValue]: "space";
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
mr: (value: string | number | {
|
|
241
|
+
readonly [$$ScaleValue]: "space";
|
|
242
|
+
}) => {
|
|
243
|
+
marginRight: string | number | {
|
|
244
|
+
readonly [$$ScaleValue]: "space";
|
|
245
|
+
};
|
|
246
|
+
};
|
|
247
|
+
mb: (value: string | number | {
|
|
248
|
+
readonly [$$ScaleValue]: "space";
|
|
249
|
+
}) => {
|
|
250
|
+
marginBottom: string | number | {
|
|
251
|
+
readonly [$$ScaleValue]: "space";
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
ml: (value: string | number | {
|
|
255
|
+
readonly [$$ScaleValue]: "space";
|
|
256
|
+
}) => {
|
|
257
|
+
marginLeft: string | number | {
|
|
258
|
+
readonly [$$ScaleValue]: "space";
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
mx: (value: string | number | {
|
|
262
|
+
readonly [$$ScaleValue]: "space";
|
|
263
|
+
}) => {
|
|
264
|
+
marginLeft: string | number | {
|
|
265
|
+
readonly [$$ScaleValue]: "space";
|
|
266
|
+
};
|
|
267
|
+
marginRight: string | number | {
|
|
268
|
+
readonly [$$ScaleValue]: "space";
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
my: (value: string | number | {
|
|
272
|
+
readonly [$$ScaleValue]: "space";
|
|
273
|
+
}) => {
|
|
274
|
+
marginTop: string | number | {
|
|
275
|
+
readonly [$$ScaleValue]: "space";
|
|
276
|
+
};
|
|
277
|
+
marginBottom: string | number | {
|
|
278
|
+
readonly [$$ScaleValue]: "space";
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
}>>;
|
|
282
|
+
declare type StyledRootProps = React.ComponentProps<typeof StyledRoot>;
|
|
283
|
+
interface TopBarProps extends StyledRootProps {
|
|
14
284
|
css?: CSS;
|
|
15
285
|
}
|
|
16
286
|
export declare const TopBar: React.FC<TopBarProps> & TopBarSubComponents;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"react";import{styled as r}from"../../stitches.js";import{useScrollPosition as
|
|
1
|
+
import t from"react";import{styled as r}from"../../stitches.js";import{useScrollPosition as s}from"../../utilities/hooks/useScrollPosition.js";import{Divider as m}from"../divider/Divider.js";import{Flex as d}from"../flex/Flex.js";import{TopBarActionIcon as l}from"./TopBarActionIcon.js";import{TopBarBrandLogo as e,TopBarBrand as p,TopBarBrandName as h}from"./TopBarBrand.js";const c=()=>t.createElement(m,{orientation:"vertical",css:{height:"$2",bg:"$tonal100"}}),g=r("div",{bg:"white",position:"sticky",display:"flex",alignItems:"center",width:"100vw",top:"0",zIndex:1,borderBottom:"1px solid $tonal100",transition:"box-shadow .2s ease-out",variants:{hasScrolled:{true:{boxShadow:"0px 4px 4px -2px rgba(31, 31, 31, 0.1);"}},size:{md:{height:"$6",[`& ${e}`]:{'&[src$=".svg"]':{height:24,width:"auto"}}},lg:{height:"$7",[`& ${e}`]:{'&[src$=".svg"]':{height:32,width:"auto"}}}}}}),x=r(d,{alignItems:"center",height:"$4",mx:"$4",width:"100%","@md":{mx:"$5"}}),o=({size:i="md",...a})=>{const{y:n}=s();return t.createElement(g,{hasScrolled:!!n,size:i},t.createElement(x,{...a}))};o.Brand=p,o.BrandLogo=e,o.BrandName=h,o.ActionIcon=l,o.Divider=c,o.displayName="TopBar";export{o as TopBar};
|
|
@@ -5,7 +5,10 @@ declare type TopBarBrandLogoProps = {
|
|
|
5
5
|
alt?: string;
|
|
6
6
|
css?: CSS;
|
|
7
7
|
};
|
|
8
|
-
export declare const TopBarBrandLogo:
|
|
8
|
+
export declare const TopBarBrandLogo: {
|
|
9
|
+
({ src, alt, css }: TopBarBrandLogoProps): JSX.Element;
|
|
10
|
+
toString(): string;
|
|
11
|
+
};
|
|
9
12
|
export declare const TopBarBrandName: import("@stitches/react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<Omit<Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "key" | keyof React.HTMLAttributes<HTMLParagraphElement>> & {
|
|
10
13
|
ref?: ((instance: HTMLParagraphElement | null) => void) | React.RefObject<HTMLParagraphElement> | null | undefined;
|
|
11
14
|
}, "size" | "css"> & import("@stitches/react/types/styled-component").TransformProps<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import n from"react";import{styled as o}from"../../stitches.js";import{Image as l}from"../image/Image.js";import{Text as m}from"../text/Text.js";const r=({src:t,alt:a="Atom Learning logo",css:e})=>n.createElement(l,{className:"topbar-brand-logo",src:t,alt:a,css:{mr:"$3",mb:"5px",...e}});r.toString=()=>".topbar-brand-logo";const c=o(m,{color:"$tonal400"}),s=o("a",{display:"flex",alignItems:"center",textDecoration:"none",color:"$tonal400","&:hover, &:focus":{textDecoration:"none"}});export{s as TopBarBrand,r as TopBarBrandLogo,c as TopBarBrandName};
|