@atom-learning/components 1.6.2 → 1.6.5

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.
@@ -1,274 +1,10 @@
1
+ import { Root } from '@radix-ui/react-accordion';
2
+ import React from 'react';
3
+ import { AccordionContent } from './AccordionContent';
1
4
  import { AccordionItem } from './AccordionItem';
2
5
  import { AccordionTrigger } from './AccordionTrigger';
3
- import { AccordionContent } from './AccordionContent';
4
- import React from 'react';
5
- declare const StyledRoot: import("@stitches/react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<(import("@radix-ui/react-accordion").AccordionSingleProps & React.RefAttributes<HTMLDivElement>) | (import("@radix-ui/react-accordion").AccordionMultipleProps & React.RefAttributes<HTMLDivElement>)>, {}, {
6
- sm: string;
7
- md: string;
8
- lg: string;
9
- xl: string;
10
- reducedMotion: string;
11
- allowMotion: string;
12
- hover: string;
13
- }, 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
- subjectEnglish: any;
66
- subjectMaths: any;
67
- subjectScience: any;
68
- subjectVerbalReasoning: any;
69
- subjectNonVerbalReasoning: any;
70
- subjectCreativeWriting: any;
71
- subjectExamSkills: any;
72
- };
73
- space: {
74
- "0": any;
75
- "1": any;
76
- "2": any;
77
- "3": any;
78
- "4": any;
79
- "5": any;
80
- "6": any;
81
- "7": any;
82
- "8": any;
83
- "9": any;
84
- };
85
- fontSizes: {
86
- xs: any;
87
- sm: any;
88
- md: any;
89
- lg: any;
90
- xl: any;
91
- "2xl": any;
92
- "3xl": any;
93
- "4xl": any;
94
- };
95
- fonts: {
96
- sans: any;
97
- mono: any;
98
- display: any;
99
- body: any;
100
- };
101
- sizes: {
102
- "0": any;
103
- "1": any;
104
- "2": any;
105
- "3": any;
106
- "4": any;
107
- "5": any;
108
- "6": any;
109
- "7": any;
110
- "8": any;
111
- };
112
- radii: {
113
- "0": any;
114
- "1": any;
115
- "2": any;
116
- "3": any;
117
- round: any;
118
- };
119
- shadows: {
120
- "0": any;
121
- "1": any;
122
- "2": any;
123
- "3": any;
124
- };
125
- }, import("@stitches/react/types/config").DefaultThemeMap, {
126
- bg: (value: {
127
- readonly [$$PropertyValue]: "background";
128
- }) => {
129
- background: {
130
- readonly [$$PropertyValue]: "background";
131
- };
132
- };
133
- inset: (value: string | number | {
134
- readonly [$$ScaleValue]: "space";
135
- }) => {
136
- top: string | number | {
137
- readonly [$$ScaleValue]: "space";
138
- };
139
- right: string | number | {
140
- readonly [$$ScaleValue]: "space";
141
- };
142
- bottom: string | number | {
143
- readonly [$$ScaleValue]: "space";
144
- };
145
- left: string | number | {
146
- readonly [$$ScaleValue]: "space";
147
- };
148
- };
149
- size: (value: string | number | {
150
- readonly [$$ScaleValue]: "size";
151
- }) => {
152
- height: string | number | {
153
- readonly [$$ScaleValue]: "size";
154
- };
155
- width: string | number | {
156
- readonly [$$ScaleValue]: "size";
157
- };
158
- };
159
- p: (value: string | number | {
160
- readonly [$$ScaleValue]: "space";
161
- }) => {
162
- padding: string | number | {
163
- readonly [$$ScaleValue]: "space";
164
- };
165
- };
166
- pt: (value: string | number | {
167
- readonly [$$ScaleValue]: "space";
168
- }) => {
169
- paddingTop: string | number | {
170
- readonly [$$ScaleValue]: "space";
171
- };
172
- };
173
- pr: (value: string | number | {
174
- readonly [$$ScaleValue]: "space";
175
- }) => {
176
- paddingRight: string | number | {
177
- readonly [$$ScaleValue]: "space";
178
- };
179
- };
180
- pb: (value: string | number | {
181
- readonly [$$ScaleValue]: "space";
182
- }) => {
183
- paddingBottom: string | number | {
184
- readonly [$$ScaleValue]: "space";
185
- };
186
- };
187
- pl: (value: string | number | {
188
- readonly [$$ScaleValue]: "space";
189
- }) => {
190
- paddingLeft: string | number | {
191
- readonly [$$ScaleValue]: "space";
192
- };
193
- };
194
- px: (value: string | number | {
195
- readonly [$$ScaleValue]: "space";
196
- }) => {
197
- paddingLeft: string | number | {
198
- readonly [$$ScaleValue]: "space";
199
- };
200
- paddingRight: string | number | {
201
- readonly [$$ScaleValue]: "space";
202
- };
203
- };
204
- py: (value: string | number | {
205
- readonly [$$ScaleValue]: "space";
206
- }) => {
207
- paddingTop: string | number | {
208
- readonly [$$ScaleValue]: "space";
209
- };
210
- paddingBottom: string | number | {
211
- readonly [$$ScaleValue]: "space";
212
- };
213
- };
214
- m: (value: string | number | {
215
- readonly [$$ScaleValue]: "space";
216
- }) => {
217
- margin: string | number | {
218
- readonly [$$ScaleValue]: "space";
219
- };
220
- };
221
- mt: (value: string | number | {
222
- readonly [$$ScaleValue]: "space";
223
- }) => {
224
- marginTop: string | number | {
225
- readonly [$$ScaleValue]: "space";
226
- };
227
- };
228
- mr: (value: string | number | {
229
- readonly [$$ScaleValue]: "space";
230
- }) => {
231
- marginRight: string | number | {
232
- readonly [$$ScaleValue]: "space";
233
- };
234
- };
235
- mb: (value: string | number | {
236
- readonly [$$ScaleValue]: "space";
237
- }) => {
238
- marginBottom: string | number | {
239
- readonly [$$ScaleValue]: "space";
240
- };
241
- };
242
- ml: (value: string | number | {
243
- readonly [$$ScaleValue]: "space";
244
- }) => {
245
- marginLeft: string | number | {
246
- readonly [$$ScaleValue]: "space";
247
- };
248
- };
249
- mx: (value: string | number | {
250
- readonly [$$ScaleValue]: "space";
251
- }) => {
252
- marginLeft: string | number | {
253
- readonly [$$ScaleValue]: "space";
254
- };
255
- marginRight: string | number | {
256
- readonly [$$ScaleValue]: "space";
257
- };
258
- };
259
- my: (value: string | number | {
260
- readonly [$$ScaleValue]: "space";
261
- }) => {
262
- marginTop: string | number | {
263
- readonly [$$ScaleValue]: "space";
264
- };
265
- marginBottom: string | number | {
266
- readonly [$$ScaleValue]: "space";
267
- };
268
- };
269
- }>>;
270
- declare type AccordionProps = React.ComponentProps<typeof StyledRoot> & {
271
- type: 'single';
6
+ declare type AccordionProps = React.ComponentProps<typeof Root> & {
7
+ type: 'single' | 'multiple';
272
8
  };
273
9
  export declare const Accordion: React.FC<AccordionProps> & {
274
10
  Item: typeof AccordionItem;
@@ -1 +1 @@
1
- import{Root as i}from"@radix-ui/react-accordion";import{AccordionItem as m}from"./AccordionItem.js";import{AccordionTrigger as c}from"./AccordionTrigger.js";import{AccordionContent as n}from"./AccordionContent.js";import d from"react";import{styled as p}from"../../stitches.js";const f=p(i,{width:"100%"}),o=({type:r="single",children:t,...e})=>d.createElement(f,{type:r,...e},t);o.Item=m,o.Content=n,o.Trigger=c,o.displayName="Accordion";export{o as Accordion};
1
+ import{Root as i}from"@radix-ui/react-accordion";import m from"react";import{styled as c}from"../../stitches.js";import{AccordionContent as n}from"./AccordionContent.js";import{AccordionItem as d}from"./AccordionItem.js";import{AccordionTrigger as p}from"./AccordionTrigger.js";const f=c(i,{width:"100%"}),o=({type:r="single",children:t,...e})=>m.createElement(f,{type:r,...e},t);o.Item=d,o.Content=n,o.Trigger=p,o.displayName="Accordion";export{o as Accordion};
@@ -1 +1 @@
1
- import{Trigger as s}from"@radix-ui/react-accordion";import a from"react";import{Box as l}from"../box/Box.js";import{Icon as f}from"../icon/Icon.js";import{ChevronDown as d}from"@atom-learning/icons";import{styled as c,theme as i}from"../../stitches.js";import{darken as r}from"polished";const n=(t,e,o,m="#fff")=>({bg:t,color:m,"&[disabled]":{bg:"$tonal100",cursor:"not-allowed",color:"$tonal400"},"&:not([disabled]):hover":{bg:e},"&:not([disabled]):active":{bg:o}}),g=c(s,{border:0,py:"$3",px:"$4",width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",'&[data-state="open"]':{borderRadius:"$0 $0 0 0","& svg":{transition:"transform 300ms",transform:"rotate(180deg)"}},'&[data-state="closed"]':{borderRadius:"$0","& svg":{transition:"transform 300ms",transform:"rotate(0deg)"}},variants:{theme:{primaryDark:n("$primaryDark",r(.1,i.colors.primaryDark.value),r(.15,i.colors.primaryDark.value)),light:n("#fff",r(.1,"#fff"),r(.15,"#fff"),"$tonal600")}}}),p=({theme:t="primaryDark",children:e,...o})=>a.createElement(g,{theme:t,...o},a.createElement(l,null,e),a.createElement(f,{is:d}));export{p as AccordionTrigger};
1
+ import{ChevronDown as d}from"@atom-learning/icons";import{Trigger as l}from"@radix-ui/react-accordion";import{darken as r}from"polished";import a from"react";import{styled as i,theme as n}from"../../stitches.js";import{Icon as f}from"../icon/Icon.js";const s=(t,e,o,m="#fff")=>({bg:t,color:m,"&[disabled]":{bg:"$tonal100",cursor:"not-allowed",color:"$tonal400"},"&:not([disabled]):hover":{bg:e},"&:not([disabled]):active":{bg:o}}),c=i(f,{transition:"transform 300ms",'[data-state="open"] > &':{transform:"rotate(180deg)"},'[data-state="closed"] > &':{transform:"rotate(0deg)"}}),p=i(l,{border:0,py:"$3",px:"$4",width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",'&[data-state="open"]':{borderRadius:"$0 $0 0 0"},'&[data-state="closed"]':{borderRadius:"$0"},variants:{theme:{primaryDark:s("$primaryDark",r(.1,n.colors.primaryDark.value),r(.15,n.colors.primaryDark.value)),light:s("#fff",r(.1,"#fff"),r(.15,"#fff"),"$tonal600")}}}),g=({theme:t="primaryDark",children:e,...o})=>a.createElement(p,{theme:t,...o},e,a.createElement(c,{is:d}));export{g as AccordionTrigger};
@@ -1,2 +1,3 @@
1
1
  import * as React from 'react';
2
- export declare const StepperSteps: React.FC;
2
+ import { IStepperStepsProps } from './types';
3
+ export declare const StepperSteps: React.FC<IStepperStepsProps>;
@@ -1 +1 @@
1
- import{createElement as a}from"react";import{styled as c}from"../../stitches.js";import{Flex as i}from"../flex/Flex.js";import{useStepper as m}from"./stepper-context/StepperContext.js";const h=c(i,{position:"relative",p:"$2",justifyContent:"center",alignItems:"center",width:"$2",height:"$2",borderRadius:"50%",border:"none",bg:"$tonal50",fontFamily:"$body",fontWeight:400,fontSize:"$sm","&:not(:first-child)":{ml:"$3"},"&:not(:last-child)::after":{content:"",width:"$1",height:"1px",position:"absolute",left:"$sizes$2"},variants:{state:{normal:{bg:"$tonal50",color:"$tonal400"},active:{bg:"$primary",color:"white"},viewed:{bg:"$primaryDark",color:"white"}},separator:{normal:{"&:not(:last-child)::after":{bg:"$tonal400"}},highlight:{"&:not(:last-child)::after":{bg:"$primary"}}}}}),$=()=>{const{steps:l,goToStep:s,activeStep:e,viewedSteps:n,allowSkip:r}=m(),p=o=>e===o?"active":n.includes(o)?"viewed":"normal";return a(i,{css:{alignItems:"center"}},l.map((o,t)=>a(h,{key:`step_${t}`,as:r?"button":"div",onClick:()=>r?s(t):void 0,state:p(t),separator:t<e?"highlight":"normal","aria-current":t===e?"step":void 0,"aria-label":`step ${t+1}`,css:{cursor:r?"pointer":"auto"}},t+1)))};export{$ as StepperSteps};
1
+ import{createElement as n}from"react";import{styled as $}from"../../stitches.js";import{Flex as s}from"../flex/Flex.js";import{useStepper as g}from"./stepper-context/StepperContext.js";const u=$(s,{position:"relative",p:"$2",justifyContent:"center",alignItems:"center",width:"$2",height:"$2",borderRadius:"50%",border:"none",bg:"$tonal50",fontFamily:"$body",fontWeight:400,fontSize:"$sm","&:not(:first-child)":{ml:"$3"},"&:not(:last-child)::after":{content:"",height:"1px",position:"absolute",left:"$sizes$2"},variants:{state:{normal:{bg:"$tonal50",color:"$tonal400"},active:{bg:"$primary",color:"white"},viewed:{bg:"$primaryDark",color:"white"}},separator:{normal:{"&:not(:last-child)::after":{bg:"$tonal50"}},highlight:{"&:not(:last-child)::after":{bg:"$primaryDark"}}}}}),f=({css:r,...p})=>{const{steps:a,goToStep:c,activeStep:l,viewedSteps:o,allowSkip:i}=g(),h=e=>l===e?"active":o.includes(e)?"viewed":"normal",m=e=>e<Math.max(...o)?"highlight":"normal";return n(s,{css:{alignItems:"center",justifyContent:"space-between",...r},...p},a.map((e,t)=>n(u,{key:`step_${t}`,as:i?"button":"div",onClick:()=>i&&o.includes(t)?c(t):void 0,state:h(t),separator:m(t),"aria-current":t===l?"step":void 0,"aria-label":`step ${t+1}`,css:{cursor:i&&o.includes(t)?"pointer":"auto","&:not(:last-child)::after":{width:(r==null?void 0:r.width)?`calc((${r.width} - ($2 * ${a.length})) / ${a.length-1})`:"$1"}}},t+1)))};export{f as StepperSteps};
@@ -1,3 +1,4 @@
1
+ import { CSS } from '../../stitches';
1
2
  export declare type Context = {
2
3
  steps: unknown[];
3
4
  goToPreviousStep: () => void;
@@ -22,3 +23,7 @@ export interface IStepperProps {
22
23
  export interface IStepperNavigateProps {
23
24
  label?: (currentStep?: number) => string;
24
25
  }
26
+ export interface IStepperStepsProps {
27
+ css?: CSS;
28
+ stepsWidth?: string;
29
+ }