@atom-learning/components 2.3.0 → 2.4.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 -3
- package/dist/components/empty-state/EmptyStateImage.d.ts +6 -273
- package/dist/components/empty-state/EmptyStateImage.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/search-field/SearchField.d.ts +15 -0
- package/dist/components/search-field/SearchField.js +1 -0
- package/dist/components/search-field/index.d.ts +1 -0
- package/dist/components/search-input/SearchInput.d.ts +1 -2
- package/dist/components/search-input/SearchInput.js +1 -1
- package/dist/components/search-input/index.d.ts +1 -0
- package/dist/docgen.json +1 -1
- package/dist/docs/SearchField.mdx +26 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
## [2.4.1](https://github.com/Atom-Learning/components/compare/v2.4.0...v2.4.1) (2022-09-21)
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
###
|
|
4
|
+
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* empty state image size ([08517df](https://github.com/Atom-Learning/components/commit/08517df0c233aedf89c169afbb5f5d39cbe33238))
|
|
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
|
|
|
@@ -1,276 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}, "css"> & import("@stitches/react/types/styled-component").TransformProps<{}, {
|
|
5
|
-
sm: string;
|
|
6
|
-
md: string;
|
|
7
|
-
lg: string;
|
|
8
|
-
xl: string;
|
|
9
|
-
reducedMotion: string;
|
|
10
|
-
allowMotion: string;
|
|
11
|
-
hover: string;
|
|
12
|
-
}> & {
|
|
13
|
-
css?: import("@stitches/react/types/css-util").CSS<{
|
|
14
|
-
sm: string;
|
|
15
|
-
md: string;
|
|
16
|
-
lg: string;
|
|
17
|
-
xl: string;
|
|
18
|
-
reducedMotion: string;
|
|
19
|
-
allowMotion: string;
|
|
20
|
-
hover: string;
|
|
21
|
-
}, {
|
|
22
|
-
colors: {
|
|
23
|
-
textForeground: any;
|
|
24
|
-
textSubtle: any;
|
|
25
|
-
textPlaceholder: any;
|
|
26
|
-
background: any;
|
|
27
|
-
backgroundAccent: any;
|
|
28
|
-
tonal50: any;
|
|
29
|
-
tonal100: any;
|
|
30
|
-
tonal200: any;
|
|
31
|
-
tonal300: any;
|
|
32
|
-
tonal400: any;
|
|
33
|
-
tonal500: any;
|
|
34
|
-
tonal600: any;
|
|
35
|
-
alpha100: any;
|
|
36
|
-
alpha150: any;
|
|
37
|
-
alpha200: any;
|
|
38
|
-
alpha250: any;
|
|
39
|
-
alpha600: any;
|
|
40
|
-
primaryLight: any;
|
|
41
|
-
primary: any;
|
|
42
|
-
primaryMid: any;
|
|
43
|
-
primaryDark: any;
|
|
44
|
-
secondary: any;
|
|
45
|
-
brandRed: any;
|
|
46
|
-
brandRedAccent: any;
|
|
47
|
-
brandGreen: any;
|
|
48
|
-
brandGreenAccent: any;
|
|
49
|
-
brandPurple: any;
|
|
50
|
-
brandPurpleAccent: any;
|
|
51
|
-
brandYellow: any;
|
|
52
|
-
brandYellowAccent: any;
|
|
53
|
-
successLight: any;
|
|
54
|
-
success: any;
|
|
55
|
-
successMid: any;
|
|
56
|
-
successDark: any;
|
|
57
|
-
dangerLight: any;
|
|
58
|
-
danger: any;
|
|
59
|
-
dangerMid: any;
|
|
60
|
-
dangerDark: any;
|
|
61
|
-
warningLight: any;
|
|
62
|
-
warning: any;
|
|
63
|
-
warningMid: any;
|
|
64
|
-
warningDark: any;
|
|
65
|
-
warningText: any;
|
|
66
|
-
subjectEnglish: any;
|
|
67
|
-
subjectMaths: any;
|
|
68
|
-
subjectScience: any;
|
|
69
|
-
subjectVerbalReasoning: any;
|
|
70
|
-
subjectNonVerbalReasoning: any;
|
|
71
|
-
subjectCreativeWriting: any;
|
|
72
|
-
subjectExamSkills: any;
|
|
73
|
-
};
|
|
74
|
-
space: {
|
|
75
|
-
"0": any;
|
|
76
|
-
"1": any;
|
|
77
|
-
"2": any;
|
|
78
|
-
"3": any;
|
|
79
|
-
"4": any;
|
|
80
|
-
"5": any;
|
|
81
|
-
"6": any;
|
|
82
|
-
"7": any;
|
|
83
|
-
"8": any;
|
|
84
|
-
"9": any;
|
|
85
|
-
};
|
|
86
|
-
fontSizes: {
|
|
87
|
-
xs: any;
|
|
88
|
-
sm: any;
|
|
89
|
-
md: any;
|
|
90
|
-
lg: any;
|
|
91
|
-
xl: any;
|
|
92
|
-
"2xl": any;
|
|
93
|
-
"3xl": any;
|
|
94
|
-
"4xl": any;
|
|
95
|
-
};
|
|
96
|
-
fonts: {
|
|
97
|
-
sans: any;
|
|
98
|
-
mono: any;
|
|
99
|
-
display: any;
|
|
100
|
-
body: any;
|
|
101
|
-
};
|
|
102
|
-
sizes: {
|
|
103
|
-
"0": any;
|
|
104
|
-
"1": any;
|
|
105
|
-
"2": any;
|
|
106
|
-
"3": any;
|
|
107
|
-
"4": any;
|
|
108
|
-
"5": any;
|
|
109
|
-
"6": any;
|
|
110
|
-
"7": any;
|
|
111
|
-
"8": any;
|
|
112
|
-
};
|
|
113
|
-
radii: {
|
|
114
|
-
"0": any;
|
|
115
|
-
"1": any;
|
|
116
|
-
"2": any;
|
|
117
|
-
"3": any;
|
|
118
|
-
round: any;
|
|
119
|
-
};
|
|
120
|
-
shadows: {
|
|
121
|
-
"0": any;
|
|
122
|
-
"1": any;
|
|
123
|
-
"2": any;
|
|
124
|
-
"3": any;
|
|
125
|
-
};
|
|
126
|
-
}, import("@stitches/react/types/config").DefaultThemeMap, {
|
|
127
|
-
bg: (value: {
|
|
128
|
-
readonly [$$PropertyValue]: "background";
|
|
129
|
-
}) => {
|
|
130
|
-
background: {
|
|
131
|
-
readonly [$$PropertyValue]: "background";
|
|
132
|
-
};
|
|
133
|
-
};
|
|
134
|
-
inset: (value: string | number | {
|
|
135
|
-
readonly [$$ScaleValue]: "space";
|
|
136
|
-
}) => {
|
|
137
|
-
top: string | number | {
|
|
138
|
-
readonly [$$ScaleValue]: "space";
|
|
139
|
-
};
|
|
140
|
-
right: string | number | {
|
|
141
|
-
readonly [$$ScaleValue]: "space";
|
|
142
|
-
};
|
|
143
|
-
bottom: string | number | {
|
|
144
|
-
readonly [$$ScaleValue]: "space";
|
|
145
|
-
};
|
|
146
|
-
left: string | number | {
|
|
147
|
-
readonly [$$ScaleValue]: "space";
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
size: (value: string | number | {
|
|
151
|
-
readonly [$$ScaleValue]: "size";
|
|
152
|
-
}) => {
|
|
153
|
-
height: string | number | {
|
|
154
|
-
readonly [$$ScaleValue]: "size";
|
|
155
|
-
};
|
|
156
|
-
width: string | number | {
|
|
157
|
-
readonly [$$ScaleValue]: "size";
|
|
158
|
-
};
|
|
159
|
-
};
|
|
160
|
-
p: (value: string | number | {
|
|
161
|
-
readonly [$$ScaleValue]: "space";
|
|
162
|
-
}) => {
|
|
163
|
-
padding: string | number | {
|
|
164
|
-
readonly [$$ScaleValue]: "space";
|
|
165
|
-
};
|
|
166
|
-
};
|
|
167
|
-
pt: (value: string | number | {
|
|
168
|
-
readonly [$$ScaleValue]: "space";
|
|
169
|
-
}) => {
|
|
170
|
-
paddingTop: string | number | {
|
|
171
|
-
readonly [$$ScaleValue]: "space";
|
|
172
|
-
};
|
|
173
|
-
};
|
|
174
|
-
pr: (value: string | number | {
|
|
175
|
-
readonly [$$ScaleValue]: "space";
|
|
176
|
-
}) => {
|
|
177
|
-
paddingRight: string | number | {
|
|
178
|
-
readonly [$$ScaleValue]: "space";
|
|
179
|
-
};
|
|
180
|
-
};
|
|
181
|
-
pb: (value: string | number | {
|
|
182
|
-
readonly [$$ScaleValue]: "space";
|
|
183
|
-
}) => {
|
|
184
|
-
paddingBottom: string | number | {
|
|
185
|
-
readonly [$$ScaleValue]: "space";
|
|
186
|
-
};
|
|
187
|
-
};
|
|
188
|
-
pl: (value: string | number | {
|
|
189
|
-
readonly [$$ScaleValue]: "space";
|
|
190
|
-
}) => {
|
|
191
|
-
paddingLeft: string | number | {
|
|
192
|
-
readonly [$$ScaleValue]: "space";
|
|
193
|
-
};
|
|
194
|
-
};
|
|
195
|
-
px: (value: string | number | {
|
|
196
|
-
readonly [$$ScaleValue]: "space";
|
|
197
|
-
}) => {
|
|
198
|
-
paddingLeft: string | number | {
|
|
199
|
-
readonly [$$ScaleValue]: "space";
|
|
200
|
-
};
|
|
201
|
-
paddingRight: string | number | {
|
|
202
|
-
readonly [$$ScaleValue]: "space";
|
|
203
|
-
};
|
|
204
|
-
};
|
|
205
|
-
py: (value: string | number | {
|
|
206
|
-
readonly [$$ScaleValue]: "space";
|
|
207
|
-
}) => {
|
|
208
|
-
paddingTop: string | number | {
|
|
209
|
-
readonly [$$ScaleValue]: "space";
|
|
210
|
-
};
|
|
211
|
-
paddingBottom: string | number | {
|
|
212
|
-
readonly [$$ScaleValue]: "space";
|
|
213
|
-
};
|
|
214
|
-
};
|
|
215
|
-
m: (value: string | number | {
|
|
216
|
-
readonly [$$ScaleValue]: "space";
|
|
217
|
-
}) => {
|
|
218
|
-
margin: string | number | {
|
|
219
|
-
readonly [$$ScaleValue]: "space";
|
|
220
|
-
};
|
|
221
|
-
};
|
|
222
|
-
mt: (value: string | number | {
|
|
223
|
-
readonly [$$ScaleValue]: "space";
|
|
224
|
-
}) => {
|
|
225
|
-
marginTop: string | number | {
|
|
226
|
-
readonly [$$ScaleValue]: "space";
|
|
227
|
-
};
|
|
228
|
-
};
|
|
229
|
-
mr: (value: string | number | {
|
|
230
|
-
readonly [$$ScaleValue]: "space";
|
|
231
|
-
}) => {
|
|
232
|
-
marginRight: string | number | {
|
|
233
|
-
readonly [$$ScaleValue]: "space";
|
|
234
|
-
};
|
|
235
|
-
};
|
|
236
|
-
mb: (value: string | number | {
|
|
237
|
-
readonly [$$ScaleValue]: "space";
|
|
238
|
-
}) => {
|
|
239
|
-
marginBottom: string | number | {
|
|
240
|
-
readonly [$$ScaleValue]: "space";
|
|
241
|
-
};
|
|
242
|
-
};
|
|
243
|
-
ml: (value: string | number | {
|
|
244
|
-
readonly [$$ScaleValue]: "space";
|
|
245
|
-
}) => {
|
|
246
|
-
marginLeft: string | number | {
|
|
247
|
-
readonly [$$ScaleValue]: "space";
|
|
248
|
-
};
|
|
249
|
-
};
|
|
250
|
-
mx: (value: string | number | {
|
|
251
|
-
readonly [$$ScaleValue]: "space";
|
|
252
|
-
}) => {
|
|
253
|
-
marginLeft: string | number | {
|
|
254
|
-
readonly [$$ScaleValue]: "space";
|
|
255
|
-
};
|
|
256
|
-
marginRight: string | number | {
|
|
257
|
-
readonly [$$ScaleValue]: "space";
|
|
258
|
-
};
|
|
259
|
-
};
|
|
260
|
-
my: (value: string | number | {
|
|
261
|
-
readonly [$$ScaleValue]: "space";
|
|
262
|
-
}) => {
|
|
263
|
-
marginTop: string | number | {
|
|
264
|
-
readonly [$$ScaleValue]: "space";
|
|
265
|
-
};
|
|
266
|
-
marginBottom: string | number | {
|
|
267
|
-
readonly [$$ScaleValue]: "space";
|
|
268
|
-
};
|
|
269
|
-
};
|
|
270
|
-
}> | undefined;
|
|
271
|
-
}, "css" | "key" | keyof import("react").ImgHTMLAttributes<HTMLImageElement>>, "as"> & {
|
|
272
|
-
as?: undefined;
|
|
273
|
-
}>, {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Image } from '../../components/image';
|
|
3
|
+
declare const EmptyStateImageContainer: import("@stitches/react/types/styled-component").StyledComponent<"div", {
|
|
274
4
|
size?: "sm" | "md" | "lg" | "xl" | "xs" | undefined;
|
|
275
5
|
}, {
|
|
276
6
|
sm: string;
|
|
@@ -538,3 +268,6 @@ export declare const EmptyStateImage: import("@stitches/react/types/styled-compo
|
|
|
538
268
|
};
|
|
539
269
|
};
|
|
540
270
|
}>>;
|
|
271
|
+
declare type EmptyStateImageProps = React.ComponentProps<typeof EmptyStateImageContainer> & React.ComponentProps<typeof Image>;
|
|
272
|
+
export declare const EmptyStateImage: React.FC<EmptyStateImageProps>;
|
|
273
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Image as
|
|
1
|
+
import t from"react";import{Image as p}from"../image/Image.js";import{styled as e}from"../../stitches.js";const h=e("div",{variants:{size:{xs:{width:"56px",height:"32px",mb:"$4"},sm:{size:"84px",mb:"$4"},md:{width:"126px",height:"72px",mb:"$4"},lg:{width:"190px",height:"142px",mb:"$5"},xl:{width:"285px",height:"213px",mb:"$5"}}}}),x=e(p,{maxHeight:"100%"}),o=({size:i,...m})=>t.createElement(h,{size:i},t.createElement(x,{...m}));export{o as EmptyStateImage};
|
|
@@ -47,6 +47,7 @@ export { RadioButton, RadioButtonGroup } from './radio-button';
|
|
|
47
47
|
export { RadioButtonField } from './radio-button-field';
|
|
48
48
|
export { RadioCard, RadioCardGroup } from './radio-card';
|
|
49
49
|
export { SearchInput } from './search-input';
|
|
50
|
+
export { SearchField } from './search-field';
|
|
50
51
|
export { Select } from './select';
|
|
51
52
|
export { SelectField } from './select-field';
|
|
52
53
|
export { Slider } from './slider';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ValidationOptions } from '../../components/form';
|
|
3
|
+
import { SearchInputProps } from '../../components/search-input';
|
|
4
|
+
declare type SearchFieldProps = SearchInputProps & {
|
|
5
|
+
description?: string;
|
|
6
|
+
label: string;
|
|
7
|
+
name: string;
|
|
8
|
+
prompt?: {
|
|
9
|
+
link: string;
|
|
10
|
+
label: string;
|
|
11
|
+
};
|
|
12
|
+
validation?: ValidationOptions;
|
|
13
|
+
};
|
|
14
|
+
export declare const SearchField: React.FC<SearchFieldProps>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as i from"react";import{useFormContext as c}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 u}from"../form/useFieldError.js";import{SearchInput as F}from"../search-input/SearchInput.js";const m=({css:p,label:a,name:r,validation:e,prompt:l,description:d,...n})=>{const{register:o}=c(),{error:t}=u(r),s=e?o(e):o;return i.createElement(f,{css:p,description:d,error:t,fieldId:r,label:a,prompt:l,required:Boolean(e==null?void 0:e.required)},i.createElement(F,{id:r,name:r,ref:s,...t&&{state:"error"},...n}))};m.displayName="SearchField";export{m as SearchField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SearchField } from './SearchField';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Input } from '../../components/input';
|
|
3
3
|
import { CSS } from '../../stitches';
|
|
4
|
-
declare type SearchInputProps = React.ComponentProps<typeof Input> & {
|
|
4
|
+
export declare type SearchInputProps = React.ComponentProps<typeof Input> & {
|
|
5
5
|
size: 'sm' | 'md';
|
|
6
6
|
css?: CSS;
|
|
7
7
|
value?: string;
|
|
@@ -9,4 +9,3 @@ declare type SearchInputProps = React.ComponentProps<typeof Input> & {
|
|
|
9
9
|
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
10
10
|
};
|
|
11
11
|
export declare const SearchInput: React.FC<SearchInputProps>;
|
|
12
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Search as
|
|
1
|
+
import{Search as z,Close as y}from"@atom-learning/icons";import*as t from"react";import{ActionIcon as H}from"../action-icon/ActionIcon.js";import{Box as I}from"../box/Box.js";import{Icon as l}from"../icon/Icon.js";import{Input as k}from"../input/Input.js";import{styled as p}from"../../stitches.js";import{useCallbackRef as L}from"../../utilities/hooks/useCallbackRef.js";var $=(e=>(e.SEARCH="SEARCH",e.CLEAR="CLEAR",e))($||{});const x=p(l,{color:"$tonal300",position:"absolute",pointerEvents:"none",variants:{size:{sm:{top:"$2",right:"$2",size:"$1"},md:{top:10,right:10,size:20}}}}),O=p(k,{'&::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, & input[type="search"]::-webkit-search-results-decoration':{display:"none"}}),u=t.forwardRef(({size:e="md",css:m,value:n,clearText:E="Clear",onChange:a,...h},b)=>{const[i,f]=L(),[v,C]=t.useState(n||""),[d,R]=t.useState(n?"CLEAR":"SEARCH");t.useImperativeHandle(b,()=>i.current);const A=()=>{var r,c;const o=i.current;if(!o)return;const s=(r=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:r.set;(c=s==null?void 0:s.call)==null||c.call(s,o,"");const w=new Event("input",{bubbles:!0});o.dispatchEvent(w),o.focus()},S=r=>{C(r.target.value),R(r.target.value?"CLEAR":"SEARCH"),a==null||a(r)},g=()=>d==="SEARCH"?t.createElement(x,{is:z,size:e,css:{size:e=="sm"?"$1":20}}):t.createElement(H,{label:E,theme:"neutral",size:e,css:{position:"absolute",top:"0",right:"$1"},onClick:A},t.createElement(l,{is:y}));return t.createElement(I,{css:{position:"relative",...m}},t.createElement(O,{ref:f,size:e,type:"search",...h,value:v,onChange:S,css:{pr:e==="sm"?"$5":"$6"}}),g())});u.displayName="SearchInput";export{u as SearchInput};
|