@atom-learning/components 2.4.1 → 2.5.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 CHANGED
@@ -1,9 +1,9 @@
1
- ## [2.4.1](https://github.com/Atom-Learning/components/compare/v2.4.0...v2.4.1) (2022-09-21)
1
+ ## [2.5.1](https://github.com/Atom-Learning/components/compare/v2.5.0...v2.5.1) (2022-09-29)
2
2
 
3
3
 
4
4
  ### Bug Fixes
5
5
 
6
- * empty state image size ([08517df](https://github.com/Atom-Learning/components/commit/08517df0c233aedf89c169afbb5f5d39cbe33238))
6
+ * **select-field:** adding hide label prop to select field ([aa41880](https://github.com/Atom-Learning/components/commit/aa41880d431f657b307a05edc41f615b74dc76b2))
7
7
 
8
8
  # [1.4.0](https://github.com/Atom-Learning/components/compare/v1.3.0...v1.4.0) (2022-04-11)
9
9
 
@@ -11,5 +11,6 @@ export declare type FieldWrapperProps = {
11
11
  };
12
12
  description?: string;
13
13
  required?: boolean;
14
+ hideLabel?: boolean;
14
15
  };
15
16
  export declare const FieldWrapper: React.FC<FieldWrapperProps>;
@@ -1 +1 @@
1
- import*as e from"react";import{Box as a}from"../box/Box.js";import{Flex as c}from"../flex/Flex.js";import{Label as f}from"../label/Label.js";import{Link as d}from"../link/Link.js";import{InlineMessage as b}from"../inline-message/InlineMessage.js";import{Description as E}from"./FieldDescription.js";const o=({css:i,children:l,error:t,fieldId:s,label:n,prompt:r,description:m,required:p})=>e.createElement(a,{css:i},e.createElement(c,{css:{justifyContent:"space-between",alignItems:"center",mb:"$3"}},e.createElement(f,{htmlFor:s,required:p},n),r&&e.createElement(d,{href:r.link,size:"sm"},r.label)),m&&e.createElement(E,{css:{mb:"$3"}},m),l,t&&e.createElement(b,{css:{mt:"$2"}},t));o.displayName="FieldWrapper";export{o as FieldWrapper};
1
+ import*as e from"react";import{Box as f}from"../box/Box.js";import{Flex as d}from"../flex/Flex.js";import{Label as b}from"../label/Label.js";import{Link as E}from"../link/Link.js";import{InlineMessage as h}from"../inline-message/InlineMessage.js";import{Description as u}from"./FieldDescription.js";import*as F from"@radix-ui/react-visually-hidden";const o=({css:i,children:s,error:t,fieldId:l,label:n,prompt:r,description:m,required:a,hideLabel:p})=>{const c=p?F.Root:d;return e.createElement(f,{css:i},e.createElement(c,{css:{justifyContent:"space-between",alignItems:"center",mb:"$3"}},e.createElement(b,{htmlFor:l,required:a},n),r&&e.createElement(E,{href:r.link,size:"sm"},r.label)),m&&e.createElement(u,{css:{mb:"$3"}},m),s,t&&e.createElement(h,{css:{mt:"$2"}},t))};o.displayName="FieldWrapper";export{o as FieldWrapper};
@@ -1 +1 @@
1
- import*as i from"react";import{useFormContext as f}from"react-hook-form";import{FieldWrapper as u}from"../field-wrapper/FieldWrapper.js";import"../field-wrapper/InlineFieldWrapper.js";import"../form/Form.js";import{useFieldError as F}from"../form/useFieldError.js";import{Select as v}from"../select/Select.js";const m=({css:l=void 0,children:p,name:e,label:d,validation:r,prompt:a,description:n,...s})=>{const{register:o}=f(),{error:t}=F(e),c=r?o(r):o;return i.createElement(u,{css:l,description:n,error:t,fieldId:e,label:d,prompt:a,required:Boolean(r==null?void 0:r.required)},i.createElement(v,{name:e,id:e,...s,ref:c,...t&&{state:"error"}},p))};m.displayName="SelectField";export{m as SelectField};
1
+ import*as i from"react";import{useFormContext as u}from"react-hook-form";import{FieldWrapper as F}from"../field-wrapper/FieldWrapper.js";import"../field-wrapper/InlineFieldWrapper.js";import"../form/Form.js";import{useFieldError as b}from"../form/useFieldError.js";import{Select as h}from"../select/Select.js";const l=({css:m=void 0,children:d,name:e,label:p,validation:r,prompt:a,description:n,hideLabel:s,...c})=>{const{register:o}=u(),{error:t}=b(e),f=r?o(r):o;return i.createElement(F,{css:m,description:n,error:t,fieldId:e,label:p,prompt:a,required:Boolean(r==null?void 0:r.required),hideLabel:s},i.createElement(h,{name:e,id:e,...c,ref:f,...t&&{state:"error"}},d))};l.displayName="SelectField";export{l as SelectField};
@@ -10,7 +10,277 @@ interface TopBarSubComponents {
10
10
  Divider: typeof TopBarDivider;
11
11
  }
12
12
  declare const TopBarDivider: () => JSX.Element;
13
- interface TopBarProps {
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 i}from"../../utilities/hooks/useScrollPosition.js";import{Divider as n}from"../divider/Divider.js";import{Flex as m}from"../flex/Flex.js";import{TopBarActionIcon as d}from"./TopBarActionIcon.js";import{TopBarBrand as p,TopBarBrandLogo as l,TopBarBrandName as s}from"./TopBarBrand.js";const c=()=>t.createElement(n,{orientation:"vertical",css:{minHeight:28,bg:"$tonal100"}}),x=r("div",{bg:"white",position:"sticky",display:"flex",alignItems:"center",width:"100vw",top:"0",height:"$6",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);"}}}}),B=r(m,{alignItems:"center",height:"$4",mx:"$4",width:"100%","@md":{mx:"$5"}}),o=e=>{const{y:a}=i();return t.createElement(x,{hasScrolled:!!a},t.createElement(B,{...e}))};o.Brand=p,o.BrandLogo=l,o.BrandName=s,o.ActionIcon=d,o.Divider=c,o.displayName="TopBar";export{o as TopBar};
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: ({ src, alt, css }: TopBarBrandLogoProps) => JSX.Element;
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 a from"react";import{styled as o}from"../../stitches.js";import{Image as n}from"../image/Image.js";import{Text as m}from"../text/Text.js";const c=({src:r,alt:t="Atom Learning logo",css:e})=>a.createElement(n,{src:r,alt:t,css:{mr:"$3",mb:"5px",'&[src$=".svg"]':{height:24,width:"auto"},...e}}),l=o(m,{color:"$tonal400"}),s=o("a",{display:"flex",alignItems:"center",textDecoration:"none",color:"$tonal400","&:hover, &:focus":{textDecoration:"none"}});export{s as TopBarBrand,c as TopBarBrandLogo,l as TopBarBrandName};
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};