@atom-learning/components 2.28.3-beta.1 → 2.29.0-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/dist/components/accordion/AccordionContent.js +1 -1
- package/dist/components/accordion/AccordionItem.js +1 -1
- package/dist/components/accordion/AccordionTrigger.d.ts +4 -5
- package/dist/components/accordion/AccordionTrigger.js +1 -1
- package/dist/components/tabs/{TabsTrigger.d.ts → TabTrigger.d.ts} +6 -3
- package/dist/components/tabs/TabTrigger.js +1 -0
- package/dist/components/tabs/Tabs.d.ts +276 -7
- package/dist/components/tabs/Tabs.js +1 -1
- package/dist/components/tabs/TabsTriggerList.d.ts +9 -5
- package/dist/components/tabs/TabsTriggerList.js +1 -1
- package/dist/components/tabs/utils.d.ts +2 -0
- package/dist/components/tabs/utils.js +1 -0
- package/dist/components/top-bar/TopBar.js +1 -1
- package/dist/docgen.json +1 -1
- package/dist/docs/Accordion.mdx +7 -56
- package/dist/docs/Tabs.mdx +57 -31
- package/dist/index.cjs.js +1 -1
- package/dist/utilities/hooks/useCallbackRef.js +1 -1
- package/dist/utilities/hooks/useScrollPosition.d.ts +3 -6
- package/dist/utilities/hooks/useScrollPosition.js +1 -1
- package/package.json +4 -4
- package/CHANGELOG.md +0 -200
- package/dist/components/tabs/TabsContent.d.ts +0 -267
- package/dist/components/tabs/TabsContent.js +0 -1
- package/dist/components/tabs/TabsTrigger.js +0 -1
- package/dist/docs/README.mdx +0 -79
- package/dist/experiments/color-scheme/ColorScheme.d.ts +0 -201
- package/dist/experiments/color-scheme/ColorScheme.js +0 -1
- package/dist/experiments/color-scheme/blue.json.js +0 -1
- package/dist/experiments/color-scheme/generateAlphaColors.d.ts +0 -1
- package/dist/experiments/color-scheme/generateAlphaColors.js +0 -1
- package/dist/experiments/color-scheme/index.d.ts +0 -1
- package/dist/experiments/color-scheme/slate.json.js +0 -1
- package/dist/experiments/color-scheme/stitches.colorscheme.config.d.ts +0 -452
- package/dist/experiments/color-scheme/stitches.colorscheme.config.js +0 -1
- package/dist/utilities/hooks/useWindowScrollPosition.d.ts +0 -6
- package/dist/utilities/hooks/useWindowScrollPosition.js +0 -1
- package/dist/utilities/hooks/useWindowSize.d.ts +0 -8
- package/dist/utilities/hooks/useWindowSize.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Content as
|
|
1
|
+
import{Content as i}from"@radix-ui/react-accordion";import t from"react";import{keyframes as e,styled as n}from"../../stitches.js";import{CSSWrapper as c}from"../../utilities/css-wrapper/CSSWrapper.js";const d=e({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),m=e({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),s=n(i,{border:0,width:"100%",bg:"#fff",'&[data-state="open"]':{borderRadius:"0 0 $0 $0"},"@allowMotion":{'&[data-state="open"]':{animation:`${d} 300ms ease-out`},'&[data-state="closed"]':{animation:`${m} 300ms ease-out`}}}),h=({children:o,css:a,...r})=>t.createElement(s,{...r},t.createElement(c,{css:a},o));export{h as AccordionContent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Item as
|
|
1
|
+
import{Item as r}from"@radix-ui/react-accordion";import m from"react";import{styled as d}from"../../stitches.js";const l=d(r,{width:"100%",overflow:"hidden","&:not(:last-child)":{mb:"$1"}}),i=({children:t,value:e,...o})=>m.createElement(l,{value:e,...o},t);export{i as AccordionItem};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
declare const StyledTrigger: import("@stitches/react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<import("@radix-ui/react-accordion").AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>>, {
|
|
3
|
+
theme?: "primaryDark" | "light" | "tonal" | undefined;
|
|
4
|
+
}, {
|
|
4
5
|
sm: string;
|
|
5
6
|
md: string;
|
|
6
7
|
lg: string;
|
|
@@ -266,8 +267,6 @@ declare const StyledTrigger: import("@stitches/react/types/styled-component").St
|
|
|
266
267
|
};
|
|
267
268
|
};
|
|
268
269
|
}>>;
|
|
269
|
-
declare type AccordionTriggerProps = React.ComponentProps<typeof StyledTrigger
|
|
270
|
-
colorScheme?: typeof ColorScheme;
|
|
271
|
-
};
|
|
270
|
+
declare type AccordionTriggerProps = React.ComponentProps<typeof StyledTrigger>;
|
|
272
271
|
export declare const AccordionTrigger: React.FC<AccordionTriggerProps>;
|
|
273
272
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ChevronDown as
|
|
1
|
+
import{ChevronDown as s}from"@atom-learning/icons";import{Trigger as l}from"@radix-ui/react-accordion";import{darken as r}from"color2k";import n from"react";import{styled as i,theme as f}from"../../stitches.js";import{Icon as d}from"../icon/Icon.js";const a=(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}}),p=i(d,{transition:"transform 300ms",'[data-state="open"] > &':{transform:"rotate(180deg)"},'[data-state="closed"] > &':{transform:"rotate(0deg)"}}),c=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:a("$primaryDark",r(f.colors.primaryDark.value,.1),r(f.colors.primaryDark.value,.15)),light:a("#fff",r("#fff",.1),r("#fff",.15),"$tonal600"),tonal:a("$tonal100",r("#fff",.1),r("#fff",.15),"$tonal500")}}}),g=({theme:t="primaryDark",children:e,...o})=>n.createElement(c,{theme:t,...o},e,n.createElement(p,{is:s}));export{g as AccordionTrigger};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
declare const
|
|
2
|
+
declare const StyledTabTrigger: import("@stitches/react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<import("@radix-ui/react-tabs").TabsTriggerProps & React.RefAttributes<HTMLButtonElement>>, {
|
|
3
|
+
theme?: "dark" | "light" | undefined;
|
|
4
|
+
}, {
|
|
3
5
|
sm: string;
|
|
4
6
|
md: string;
|
|
5
7
|
lg: string;
|
|
@@ -265,8 +267,9 @@ declare const StyledTabsTrigger: import("@stitches/react/types/styled-component"
|
|
|
265
267
|
};
|
|
266
268
|
};
|
|
267
269
|
}>>;
|
|
268
|
-
interface
|
|
270
|
+
interface TabTriggerProps extends React.ComponentProps<typeof StyledTabTrigger> {
|
|
269
271
|
value: string;
|
|
272
|
+
disabled?: boolean;
|
|
270
273
|
}
|
|
271
|
-
export declare const
|
|
274
|
+
export declare const TabTrigger: React.FC<TabTriggerProps>;
|
|
272
275
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Trigger as l}from"@radix-ui/react-tabs";import{opacify as o}from"color2k";import*as n from"react";import{styled as s,theme as e}from"../../stitches.js";const c=s(l,{background:"none",border:"none",cursor:"pointer",flexShrink:0,fontFamily:"$body",p:"$4",height:"$5",userSelect:"none",transition:"0.3s",variants:{theme:{light:{'&[data-state="active"]':{color:"$primary",fontWeight:600,letterSpacing:"-0.005em",boxShadow:"inset 0 -2px 0 0 currentColor"},'&[data-state="inactive"]':{color:"$tonal500"},"&:not([data-disabled]):hover":{color:"$primary",bg:o(e.colors.primary.value,-.9)},"&:not([data-disabled]):active":{color:"$primary",bg:o(e.colors.primary.value,-.8),boxShadow:"none"},"&[data-disabled],&[data-disabled]:hover":{color:"$tonal200",cursor:"not-allowed"}},dark:{color:"white",'&[data-state="active"]':{fontWeight:600,letterSpacing:"-0.005em",boxShadow:"inset 0 -2px 0 0 currentColor"},"&:not([data-disabled]):hover":{bg:o("white",-.8)},"&:not([data-disabled]):active":{bg:o("white",-.7),boxShadow:"none"},"&[data-disabled],&[data-disabled]:hover":{color:"$tonal200",cursor:"not-allowed"}}}}}),a=({children:t,theme:r,disabled:i=!1,...d})=>n.createElement(c,{disabled:i,theme:r,...d},t);a.displayName="TabTrigger";export{a as TabTrigger};
|
|
@@ -1,9 +1,278 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { TabsContent } from './TabsContent';
|
|
2
|
+
import { TriggerListWrapper } from './TabsTriggerList';
|
|
3
|
+
import { TabTrigger } from './TabTrigger';
|
|
5
4
|
declare type TabsProps = React.ComponentProps<typeof StyledRoot>;
|
|
6
|
-
declare const StyledRoot: import("@stitches/react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<import("@radix-ui/react-tabs").TabsProps & React.RefAttributes<HTMLDivElement>>, {
|
|
5
|
+
declare const StyledRoot: import("@stitches/react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<import("@radix-ui/react-tabs").TabsProps & React.RefAttributes<HTMLDivElement>>, {
|
|
6
|
+
theme?: "dark" | "light" | undefined;
|
|
7
|
+
}, {
|
|
8
|
+
sm: string;
|
|
9
|
+
md: string;
|
|
10
|
+
lg: string;
|
|
11
|
+
xl: string;
|
|
12
|
+
reducedMotion: string;
|
|
13
|
+
allowMotion: string;
|
|
14
|
+
hover: string;
|
|
15
|
+
}, import("@stitches/react/types/css-util").CSS<{
|
|
16
|
+
sm: string;
|
|
17
|
+
md: string;
|
|
18
|
+
lg: string;
|
|
19
|
+
xl: string;
|
|
20
|
+
reducedMotion: string;
|
|
21
|
+
allowMotion: string;
|
|
22
|
+
hover: string;
|
|
23
|
+
}, {
|
|
24
|
+
colors: {
|
|
25
|
+
textForeground: any;
|
|
26
|
+
textSubtle: any;
|
|
27
|
+
textPlaceholder: any;
|
|
28
|
+
background: any;
|
|
29
|
+
backgroundAccent: any;
|
|
30
|
+
tonal50: any;
|
|
31
|
+
tonal100: any;
|
|
32
|
+
tonal200: any;
|
|
33
|
+
tonal300: any;
|
|
34
|
+
tonal400: any;
|
|
35
|
+
tonal500: any;
|
|
36
|
+
tonal600: any;
|
|
37
|
+
alpha100: any;
|
|
38
|
+
alpha150: any;
|
|
39
|
+
alpha200: any;
|
|
40
|
+
alpha250: any;
|
|
41
|
+
alpha600: any;
|
|
42
|
+
primaryLight: any;
|
|
43
|
+
primary: any;
|
|
44
|
+
primaryMid: any;
|
|
45
|
+
primaryDark: any;
|
|
46
|
+
secondary: any;
|
|
47
|
+
brandRed: any;
|
|
48
|
+
brandRedAccent: any;
|
|
49
|
+
brandGreen: any;
|
|
50
|
+
brandGreenAccent: any;
|
|
51
|
+
brandPurple: any;
|
|
52
|
+
brandPurpleAccent: any;
|
|
53
|
+
brandYellow: any;
|
|
54
|
+
brandYellowAccent: any;
|
|
55
|
+
successLight: any;
|
|
56
|
+
success: any;
|
|
57
|
+
successMid: any;
|
|
58
|
+
successDark: any;
|
|
59
|
+
dangerLight: any;
|
|
60
|
+
danger: any;
|
|
61
|
+
dangerMid: any;
|
|
62
|
+
dangerDark: any;
|
|
63
|
+
warningLight: any;
|
|
64
|
+
warning: any;
|
|
65
|
+
warningMid: any;
|
|
66
|
+
warningDark: any;
|
|
67
|
+
warningText: any;
|
|
68
|
+
subjectEnglish: any;
|
|
69
|
+
subjectMaths: any;
|
|
70
|
+
subjectScience: any;
|
|
71
|
+
subjectVerbalReasoning: any;
|
|
72
|
+
subjectNonVerbalReasoning: any;
|
|
73
|
+
subjectCreativeWriting: any;
|
|
74
|
+
subjectExamSkills: any;
|
|
75
|
+
};
|
|
76
|
+
space: {
|
|
77
|
+
"0": any;
|
|
78
|
+
"1": any;
|
|
79
|
+
"2": any;
|
|
80
|
+
"3": any;
|
|
81
|
+
"4": any;
|
|
82
|
+
"5": any;
|
|
83
|
+
"6": any;
|
|
84
|
+
"7": any;
|
|
85
|
+
"8": any;
|
|
86
|
+
"9": any;
|
|
87
|
+
};
|
|
88
|
+
fontSizes: {
|
|
89
|
+
xs: any;
|
|
90
|
+
sm: any;
|
|
91
|
+
md: any;
|
|
92
|
+
lg: any;
|
|
93
|
+
xl: any;
|
|
94
|
+
"2xl": any;
|
|
95
|
+
"3xl": any;
|
|
96
|
+
"4xl": any;
|
|
97
|
+
};
|
|
98
|
+
fonts: {
|
|
99
|
+
sans: any;
|
|
100
|
+
mono: any;
|
|
101
|
+
display: any;
|
|
102
|
+
body: any;
|
|
103
|
+
};
|
|
104
|
+
sizes: {
|
|
105
|
+
"0": any;
|
|
106
|
+
"1": any;
|
|
107
|
+
"2": any;
|
|
108
|
+
"3": any;
|
|
109
|
+
"4": any;
|
|
110
|
+
"5": any;
|
|
111
|
+
"6": any;
|
|
112
|
+
"7": any;
|
|
113
|
+
"8": any;
|
|
114
|
+
};
|
|
115
|
+
radii: {
|
|
116
|
+
"0": any;
|
|
117
|
+
"1": any;
|
|
118
|
+
"2": any;
|
|
119
|
+
"3": any;
|
|
120
|
+
round: any;
|
|
121
|
+
};
|
|
122
|
+
shadows: {
|
|
123
|
+
"0": any;
|
|
124
|
+
"1": any;
|
|
125
|
+
"2": any;
|
|
126
|
+
"3": any;
|
|
127
|
+
};
|
|
128
|
+
}, import("@stitches/react/types/config").DefaultThemeMap, {
|
|
129
|
+
bg: (value: {
|
|
130
|
+
readonly [$$PropertyValue]: "background";
|
|
131
|
+
}) => {
|
|
132
|
+
background: {
|
|
133
|
+
readonly [$$PropertyValue]: "background";
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
inset: (value: string | number | {
|
|
137
|
+
readonly [$$ScaleValue]: "space";
|
|
138
|
+
}) => {
|
|
139
|
+
top: string | number | {
|
|
140
|
+
readonly [$$ScaleValue]: "space";
|
|
141
|
+
};
|
|
142
|
+
right: string | number | {
|
|
143
|
+
readonly [$$ScaleValue]: "space";
|
|
144
|
+
};
|
|
145
|
+
bottom: string | number | {
|
|
146
|
+
readonly [$$ScaleValue]: "space";
|
|
147
|
+
};
|
|
148
|
+
left: string | number | {
|
|
149
|
+
readonly [$$ScaleValue]: "space";
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
size: (value: string | number | {
|
|
153
|
+
readonly [$$ScaleValue]: "size";
|
|
154
|
+
}) => {
|
|
155
|
+
height: string | number | {
|
|
156
|
+
readonly [$$ScaleValue]: "size";
|
|
157
|
+
};
|
|
158
|
+
width: string | number | {
|
|
159
|
+
readonly [$$ScaleValue]: "size";
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
p: (value: string | number | {
|
|
163
|
+
readonly [$$ScaleValue]: "space";
|
|
164
|
+
}) => {
|
|
165
|
+
padding: string | number | {
|
|
166
|
+
readonly [$$ScaleValue]: "space";
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
pt: (value: string | number | {
|
|
170
|
+
readonly [$$ScaleValue]: "space";
|
|
171
|
+
}) => {
|
|
172
|
+
paddingTop: string | number | {
|
|
173
|
+
readonly [$$ScaleValue]: "space";
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
pr: (value: string | number | {
|
|
177
|
+
readonly [$$ScaleValue]: "space";
|
|
178
|
+
}) => {
|
|
179
|
+
paddingRight: string | number | {
|
|
180
|
+
readonly [$$ScaleValue]: "space";
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
pb: (value: string | number | {
|
|
184
|
+
readonly [$$ScaleValue]: "space";
|
|
185
|
+
}) => {
|
|
186
|
+
paddingBottom: string | number | {
|
|
187
|
+
readonly [$$ScaleValue]: "space";
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
pl: (value: string | number | {
|
|
191
|
+
readonly [$$ScaleValue]: "space";
|
|
192
|
+
}) => {
|
|
193
|
+
paddingLeft: string | number | {
|
|
194
|
+
readonly [$$ScaleValue]: "space";
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
px: (value: string | number | {
|
|
198
|
+
readonly [$$ScaleValue]: "space";
|
|
199
|
+
}) => {
|
|
200
|
+
paddingLeft: string | number | {
|
|
201
|
+
readonly [$$ScaleValue]: "space";
|
|
202
|
+
};
|
|
203
|
+
paddingRight: string | number | {
|
|
204
|
+
readonly [$$ScaleValue]: "space";
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
py: (value: string | number | {
|
|
208
|
+
readonly [$$ScaleValue]: "space";
|
|
209
|
+
}) => {
|
|
210
|
+
paddingTop: string | number | {
|
|
211
|
+
readonly [$$ScaleValue]: "space";
|
|
212
|
+
};
|
|
213
|
+
paddingBottom: string | number | {
|
|
214
|
+
readonly [$$ScaleValue]: "space";
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
m: (value: string | number | {
|
|
218
|
+
readonly [$$ScaleValue]: "space";
|
|
219
|
+
}) => {
|
|
220
|
+
margin: string | number | {
|
|
221
|
+
readonly [$$ScaleValue]: "space";
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
mt: (value: string | number | {
|
|
225
|
+
readonly [$$ScaleValue]: "space";
|
|
226
|
+
}) => {
|
|
227
|
+
marginTop: string | number | {
|
|
228
|
+
readonly [$$ScaleValue]: "space";
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
mr: (value: string | number | {
|
|
232
|
+
readonly [$$ScaleValue]: "space";
|
|
233
|
+
}) => {
|
|
234
|
+
marginRight: string | number | {
|
|
235
|
+
readonly [$$ScaleValue]: "space";
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
mb: (value: string | number | {
|
|
239
|
+
readonly [$$ScaleValue]: "space";
|
|
240
|
+
}) => {
|
|
241
|
+
marginBottom: string | number | {
|
|
242
|
+
readonly [$$ScaleValue]: "space";
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
ml: (value: string | number | {
|
|
246
|
+
readonly [$$ScaleValue]: "space";
|
|
247
|
+
}) => {
|
|
248
|
+
marginLeft: string | number | {
|
|
249
|
+
readonly [$$ScaleValue]: "space";
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
mx: (value: string | number | {
|
|
253
|
+
readonly [$$ScaleValue]: "space";
|
|
254
|
+
}) => {
|
|
255
|
+
marginLeft: string | number | {
|
|
256
|
+
readonly [$$ScaleValue]: "space";
|
|
257
|
+
};
|
|
258
|
+
marginRight: string | number | {
|
|
259
|
+
readonly [$$ScaleValue]: "space";
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
my: (value: string | number | {
|
|
263
|
+
readonly [$$ScaleValue]: "space";
|
|
264
|
+
}) => {
|
|
265
|
+
marginTop: string | number | {
|
|
266
|
+
readonly [$$ScaleValue]: "space";
|
|
267
|
+
};
|
|
268
|
+
marginBottom: string | number | {
|
|
269
|
+
readonly [$$ScaleValue]: "space";
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
}>>;
|
|
273
|
+
declare const StyledTabContent: import("@stitches/react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<import("@radix-ui/react-tabs").TabsContentProps & React.RefAttributes<HTMLDivElement>>, {
|
|
274
|
+
theme?: "dark" | "light" | undefined;
|
|
275
|
+
}, {
|
|
7
276
|
sm: string;
|
|
8
277
|
md: string;
|
|
9
278
|
lg: string;
|
|
@@ -270,8 +539,8 @@ declare const StyledRoot: import("@stitches/react/types/styled-component").Style
|
|
|
270
539
|
};
|
|
271
540
|
}>>;
|
|
272
541
|
export declare const Tabs: React.FC<TabsProps> & {
|
|
273
|
-
TriggerList: typeof
|
|
274
|
-
Trigger: typeof
|
|
275
|
-
Content: typeof
|
|
542
|
+
TriggerList: typeof TriggerListWrapper;
|
|
543
|
+
Trigger: typeof TabTrigger;
|
|
544
|
+
Content: typeof StyledTabContent;
|
|
276
545
|
};
|
|
277
546
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Root as
|
|
1
|
+
import{Root as l,Content as n}from"@radix-ui/react-tabs";import*as p from"react";import{styled as e}from"../../stitches.js";import{TriggerListWrapper as o}from"./TabsTriggerList.js";import{TabTrigger as s}from"./TabTrigger.js";import{passPropsToChildren as g}from"./utils.js";const h=e(l,{display:"flex",flexDirection:"column",variants:{theme:{light:{color:"$primary"},dark:{color:"white"}}}}),i=e(n,{flexGrow:1,fontFamily:"$body",variants:{theme:{light:{color:"$textForeground"},dark:{bg:"$primaryDark",color:"white"}}}}),r=({theme:t="light",children:m,...a})=>p.createElement(h,{theme:t,...a},g(m,{theme:t},[o,i]));r.TriggerList=o,r.Trigger=s,r.Content=i,r.displayName="Tabs";export{r as Tabs};
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
interface ListProps extends React.ComponentProps<typeof StyledTriggerList> {
|
|
3
|
+
enableTabScrolling?: boolean;
|
|
4
|
+
scrollPercentage?: number;
|
|
5
|
+
}
|
|
6
|
+
declare const StyledTriggerList: import("@stitches/react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<import("@radix-ui/react-tabs").TabsListProps & React.RefAttributes<HTMLDivElement>>, {
|
|
7
|
+
theme?: "dark" | "light" | undefined;
|
|
8
|
+
appearance?: "uppercase" | undefined;
|
|
9
|
+
}, {
|
|
4
10
|
sm: string;
|
|
5
11
|
md: string;
|
|
6
12
|
lg: string;
|
|
@@ -266,7 +272,5 @@ declare const StyledTriggerList: import("@stitches/react/types/styled-component"
|
|
|
266
272
|
};
|
|
267
273
|
};
|
|
268
274
|
}>>;
|
|
269
|
-
export declare const
|
|
270
|
-
colorScheme?: typeof ColorScheme;
|
|
271
|
-
}>;
|
|
275
|
+
export declare const TriggerListWrapper: React.FC<ListProps>;
|
|
272
276
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ChevronLeft as P,ChevronRight as R}from"@atom-learning/icons";import{List as _}from"@radix-ui/react-tabs";import{opacify as y}from"color2k";import o,{useRef as F,useState as f,useCallback as J,useEffect as k}from"react";import{debounce as K}from"throttle-debounce";import{ActionIcon as M}from"../action-icon/ActionIcon.js";import{Flex as X}from"../flex/Flex.js";import{Icon as W}from"../icon/Icon.js";import{theme as j,styled as x}from"../../stitches.js";import{TabTrigger as L}from"./TabTrigger.js";import{passPropsToChildren as C}from"./utils.js";const q=y("white",-.2),G=y(j.colors.primaryDark.value,-.2),T=x(M,{position:"absolute",transition:"all 125ms",variants:{theme:{light:{bg:`${q} !important`},dark:{bg:`${G} !important`,color:"currentColor !important"}},visible:{true:{opacity:1,visibility:"visible",pointerEvents:"all"},false:{opacity:0,visibility:"hidden",pointerEvents:"none"}}}}),S=x(_,{flexShrink:0,display:"flex",width:"100%",overflowX:"auto","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none",variants:{theme:{light:{borderBottom:"1px solid $tonal300"},dark:{bg:"$primaryDark",borderBottom:"1px solid $tonal200"}},appearance:{uppercase:{"& button":{textTransform:"uppercase"}}}}}),H=({children:h,theme:i,appearance:d,enableTabScrolling:$,scrollPercentage:z=10,...b})=>{const s=F(null),[u,a]=f(!1),[v,c]=f(!1),[D,I]=f(),g=J(t=>{const e=s.current;if(e){const{scrollWidth:l,scrollLeft:n,offsetWidth:m}=e,E=Math.round(l*(z/100));let p=n;if(t==="right"){const r=n+E;p=r+m<=l?r:l-m}else{const r=n-E;p=r>0?r:0}e.scroll({left:p,behavior:"smooth"}),setTimeout(()=>{const{scrollWidth:r,scrollLeft:w,offsetWidth:A}=e,B=r-(w+A);w===0?(a(!1),c(!0)):B<5?(c(!1),a(!0)):(a(!0),c(!0))},500)}},[]);return k(()=>{const t=K(500,()=>{I(window.innerWidth)});return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[]),k(()=>{var t;const e=s.current;if(e){const{offsetWidth:l,scrollWidth:n}=e,m=n>l;(t=e.scroll)==null||t.call(e,{left:0}),a(!1),c(m)}},[D]),u||v||$?o.createElement(X,{css:{position:"relative"}},o.createElement(T,{size:"lg",label:"Scroll Left",theme:i,onClick:()=>g("left"),visible:u,css:{left:0}},o.createElement(W,{is:P})),o.createElement(S,{...b,ref:s,appearance:d,theme:i},C(h,{theme:i},[L])),o.createElement(T,{size:"lg",label:"Scroll right",theme:i,onClick:()=>g("right"),visible:v,css:{right:0}},o.createElement(W,{is:R}))):o.createElement(S,{theme:i,...b,appearance:d,ref:s},C(h,{theme:i},[L]))};export{H as TriggerListWrapper};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import n from"react";const i=(o,t,e=[])=>n.Children.map(o,l=>n.isValidElement(l)&&e.includes(l==null?void 0:l.type)?n.cloneElement(l,{...t}):l);export{i as passPropsToChildren};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"react";import{styled as r}from"../../stitches.js";import{
|
|
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};
|