@ndla/preset-panda 0.0.53 → 0.0.55
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/README.md +148 -0
- package/es/animations.js +111 -223
- package/es/animations.js.map +1 -0
- package/es/boxShadows.js +33 -37
- package/es/boxShadows.js.map +1 -0
- package/es/colors.js +132 -346
- package/es/colors.js.map +1 -0
- package/es/conditions.js +16 -12
- package/es/conditions.js.map +1 -0
- package/es/globalCss.js +149 -226
- package/es/globalCss.js.map +1 -0
- package/es/index.js +43 -45
- package/es/index.js.map +1 -0
- package/es/plugins/forwardCssPropPlugin.js +39 -46
- package/es/plugins/forwardCssPropPlugin.js.map +1 -0
- package/es/radii.js +14 -28
- package/es/radii.js.map +1 -0
- package/es/semanticTokens.js +233 -549
- package/es/semanticTokens.js.map +1 -0
- package/es/spacing.js +50 -136
- package/es/spacing.js.map +1 -0
- package/es/typography.js +200 -274
- package/es/typography.js.map +1 -0
- package/es/zIndex.js +22 -52
- package/es/zIndex.js.map +1 -0
- package/lib/_virtual/rolldown_runtime.js +30 -0
- package/lib/animations.js +115 -229
- package/lib/animations.js.map +1 -0
- package/lib/boxShadows.js +32 -41
- package/lib/boxShadows.js.map +1 -0
- package/lib/colors.js +131 -350
- package/lib/colors.js.map +1 -0
- package/lib/conditions.js +16 -17
- package/lib/conditions.js.map +1 -0
- package/lib/globalCss.js +148 -230
- package/lib/globalCss.js.map +1 -0
- package/lib/index.js +47 -58
- package/lib/index.js.map +1 -0
- package/lib/plugins/forwardCssPropPlugin.js +37 -51
- package/lib/plugins/forwardCssPropPlugin.js.map +1 -0
- package/lib/radii.js +13 -32
- package/lib/radii.js.map +1 -0
- package/lib/semanticTokens.js +232 -553
- package/lib/semanticTokens.js.map +1 -0
- package/lib/spacing.js +49 -140
- package/lib/spacing.js.map +1 -0
- package/lib/typography.js +205 -280
- package/lib/typography.js.map +1 -0
- package/lib/zIndex.js +21 -56
- package/lib/zIndex.js.map +1 -0
- package/package.json +6 -5
package/README.md
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# @ndla/preset-panda
|
|
2
|
+
|
|
3
|
+
The styling solution used across all NDLA solutions, powered by and built upon [PandaCSS](https://pandacss.com)
|
|
4
|
+
|
|
5
|
+
## What this package is
|
|
6
|
+
|
|
7
|
+
PandaCSS is a compile-time styling solution powered by PostCSS. At its core it is framework-agnostic, but it also provides thin wrappers for popular JavaScript frameworks. We use the React wrapper. This package exports a preset for PandaCSS, allowing for developers aligned with NDLA to create components using a shared design language. Tokens are exported as plain css variables, and as a Panda preset.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
yarn add -D @ndla/preset-panda @pandacss/dev postcss
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
This package can be consumed through panda or through plain css. Either way, add this to your css file.
|
|
19
|
+
|
|
20
|
+
```css
|
|
21
|
+
@layer reset, base, tokens, recipes, utilities;
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### With Panda
|
|
25
|
+
|
|
26
|
+
Setup panda as you normally would, and add the NDLA preset.
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import preset from "@ndla/preset-panda";
|
|
30
|
+
export default defineConfig({
|
|
31
|
+
presets: [preset],
|
|
32
|
+
});
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### With plain css
|
|
36
|
+
|
|
37
|
+
```css
|
|
38
|
+
/* Probably need a css reset here as well */
|
|
39
|
+
@import "@ndla/preset-panda/dist/styles.css";
|
|
40
|
+
@import "@ndla/primitives/dist/styles.css";
|
|
41
|
+
@import "@ndla/icons/dist/styles.css";
|
|
42
|
+
@import "@ndla/ui/dist/styles.css";
|
|
43
|
+
@import "@ndla/safelink/dist/styles.css";
|
|
44
|
+
|
|
45
|
+
@layer reset, base, tokens, recipes, utilities;
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Plugin for forwarding css prop
|
|
49
|
+
|
|
50
|
+
This package also provides a special plugin that alters the styled system that panda exposes. You can read more about the behavioral changes it introduces [here](./src/plugins/README.md) If you use `@ndla/styled-system`, it is already enabled by default. If you only want to use the plugin, it can be added to any panda configuration by adding it to your plugins.
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
import { forwardCssPropPlugin } from "@ndla/preset-panda";
|
|
54
|
+
export default defineConfig({
|
|
55
|
+
plugins: [forwardCssPropPlugin],
|
|
56
|
+
});
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Guidelines
|
|
60
|
+
|
|
61
|
+
We strive to keep this package as lean as possible, as most other NDLA packages relies upon it, either directly or indirectly. As such, try to keep the `globalCss.ts` file as lean as possible. It is currently reserved for the following scenarios:
|
|
62
|
+
|
|
63
|
+
- Truly global css
|
|
64
|
+
- Resets
|
|
65
|
+
- Global font styling
|
|
66
|
+
- Body styling
|
|
67
|
+
- Extremely large pieces of css
|
|
68
|
+
- Article styling
|
|
69
|
+
- Code block styling (for now).
|
|
70
|
+
|
|
71
|
+
### Semantic tokens
|
|
72
|
+
|
|
73
|
+
Always prefer using semantic tokens wherever possible. Values defined in [colors.ts](./src/colors.ts) and [spacing.ts](./src/spacing.ts) should only be used if absolutely necessary. If the current semantic tokens do not fit your needs, let us know.
|
|
74
|
+
|
|
75
|
+
### Style properties
|
|
76
|
+
|
|
77
|
+
Prefer properties with proper completion and type safety.
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
const bad = css({
|
|
81
|
+
border: "1px solid token(colors.stroke.default)",
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
const good = css({
|
|
85
|
+
border: "1px solid",
|
|
86
|
+
borderColor: "stroke.default",
|
|
87
|
+
});
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Prefer style properties that are already used throughout the code base, and that can be easily overridden.
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
// Can only be overridden with backgroundColor
|
|
94
|
+
const bad = css({
|
|
95
|
+
backgroundColor: "surface.default",
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
// Can be overridden with both `background` and backgroundColor
|
|
99
|
+
const good = css({
|
|
100
|
+
background: "surface.default",
|
|
101
|
+
});
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
There's a couple of exceptions to this rule, mostly to do with padding and margins. Read source code to get a grasp of how we use those properties :)
|
|
105
|
+
|
|
106
|
+
## Styling Justifications
|
|
107
|
+
|
|
108
|
+
### Shorthand vs longhand properties
|
|
109
|
+
|
|
110
|
+
We prefer using longhand properties wherever possible, and our code generation reflects this. We landed on using longhand properties to lower the cost of entry into the panda ecosystem. Diverging from default css is already a big ask for new developers. By maintaining the likeness with regular css (naming-wise), we hope to encourage developers to write css as they normally would, just camel-cased instead of kebab-cased :)
|
|
111
|
+
|
|
112
|
+
### Styling props
|
|
113
|
+
|
|
114
|
+
PandaCSS offers three styling options when using a framework wrapper: the `css` prop, a `styled-system` like approach, and simple class names. We landed on the `css` approach. Instead of explaining why we landed on this, let's instead explain why we avoid the `styled-system` approach
|
|
115
|
+
|
|
116
|
+
#### Vendor lock-in
|
|
117
|
+
|
|
118
|
+
The biggest disadvantage to using a styled-system approach is that a full rewrite becomes less feasible the more you invest into the Panda ecosystem. Let's compare the two approaches.
|
|
119
|
+
|
|
120
|
+
##### styled-system
|
|
121
|
+
|
|
122
|
+
```tsx
|
|
123
|
+
return <Box display="flex" gap="xsmall" alignItems="center" justifyContent="center" />;
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
##### Minimal (styled somewhere else)
|
|
127
|
+
|
|
128
|
+
```tsx
|
|
129
|
+
return <ListContainer />;
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
The latter example is much more independent from the actual styling solution, allowing for 1:1 rewrites without having to mess with the file history. Furthermore, we believe the latter to be more readable. See complex tailwind components for more horror stories.
|
|
133
|
+
|
|
134
|
+
#### Performance
|
|
135
|
+
|
|
136
|
+
The styled-system approach is extremely flexible, but also comes at a cost. According to [benchmarks](https://github.com/chakra-ui/panda/discussions/2604), that cost is about a 30% drop in performance. We did not want to compromise on that!
|
|
137
|
+
|
|
138
|
+
### Strict property values
|
|
139
|
+
|
|
140
|
+
This is a no-brainer. We want type safety wherever possible.
|
|
141
|
+
|
|
142
|
+
### Why not strictTokens?
|
|
143
|
+
|
|
144
|
+
Turning on strictTokens would allow us to enforce our design system to a much greater extent. In a nutshell, this option only allows tokens that are defined explicitly in `@ndla/preset-panda`. We felt this to be too restrictive. Defining every single css value we use is simply too much, and the escape hatch from this breaks autocomplete entirely.
|
|
145
|
+
|
|
146
|
+
### Preflight position
|
|
147
|
+
|
|
148
|
+
A preflight is more or less a css reset: A small set of css rules that evens out some styling considerations different browsers have decided to have as their defaults. We've chosen to only turn this on where packages are consumed, namely ndla-frontend and editorial-frontend. Enabling it in a package would force all consumers to use our styling reset. Furthermore, it could generate css that neither us nor the consumer actually needs. This is open to change, however. After all, we assume that our reset (or a similar reset) is used.
|
package/es/animations.js
CHANGED
|
@@ -1,227 +1,115 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2024-present, NDLA.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
1
|
import { defineTokens } from "@pandacss/dev";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
"dialog-in": {
|
|
33
|
-
value: "fade-in 400ms {easings.emphasized-in}"
|
|
34
|
-
},
|
|
35
|
-
"dialog-out": {
|
|
36
|
-
value: "fade-out 200ms {easings.emphasized-out}"
|
|
37
|
-
},
|
|
38
|
-
"drawer-in-left": {
|
|
39
|
-
value: "slide-in-left 400ms {easings.emphasized-in}"
|
|
40
|
-
},
|
|
41
|
-
"drawer-out-left": {
|
|
42
|
-
value: "slide-out-left 200ms {easings.emphasized-out}"
|
|
43
|
-
},
|
|
44
|
-
"drawer-in-right": {
|
|
45
|
-
value: "slide-in-right 400ms {easings.emphasized-in}"
|
|
46
|
-
},
|
|
47
|
-
"drawer-out-right": {
|
|
48
|
-
value: "slide-out-right 200ms {easings.emphasized-out}"
|
|
49
|
-
},
|
|
50
|
-
"drawer-in-bottom": {
|
|
51
|
-
value: "slide-in-bottom 400ms {easings.emphasized-in}"
|
|
52
|
-
},
|
|
53
|
-
"drawer-out-bottom": {
|
|
54
|
-
value: "slide-out-bottom 200ms {easings.emphasized-out}"
|
|
55
|
-
},
|
|
56
|
-
"drawer-in-top": {
|
|
57
|
-
value: "slide-in-top 400ms {easings.emphasized-in}"
|
|
58
|
-
},
|
|
59
|
-
"drawer-out-top": {
|
|
60
|
-
value: "slide-out-top 200ms {easings.emphasized-out}"
|
|
61
|
-
},
|
|
62
|
-
"skeleton-pulse": {
|
|
63
|
-
value: "skeleton-pulse 2s {easings.pulse} infinite"
|
|
64
|
-
}
|
|
2
|
+
|
|
3
|
+
//#region src/animations.ts
|
|
4
|
+
const animations = defineTokens.animations({
|
|
5
|
+
spin: { value: "spin 700ms infinite linear" },
|
|
6
|
+
"collapse-in": { value: "collapse-in 250ms {easings.emphasized-in}" },
|
|
7
|
+
"collapse-out": { value: "collapse-out 200ms {easings.emphasized-out}" },
|
|
8
|
+
"fade-shift-in": { value: "fade-shift-in 200ms {easings.emphasized-in}" },
|
|
9
|
+
"fade-shift-out": { value: "fade-shift-in 200ms {easings.emphasized-in}" },
|
|
10
|
+
"backdrop-in": { value: "fade-in 250ms {easings.emphasized-in}" },
|
|
11
|
+
"backdrop-out": { value: "fade-out 200ms {easings.emphasized-out}" },
|
|
12
|
+
"dialog-in": { value: "fade-in 400ms {easings.emphasized-in}" },
|
|
13
|
+
"dialog-out": { value: "fade-out 200ms {easings.emphasized-out}" },
|
|
14
|
+
"drawer-in-left": { value: "slide-in-left 400ms {easings.emphasized-in}" },
|
|
15
|
+
"drawer-out-left": { value: "slide-out-left 200ms {easings.emphasized-out}" },
|
|
16
|
+
"drawer-in-right": { value: "slide-in-right 400ms {easings.emphasized-in}" },
|
|
17
|
+
"drawer-out-right": { value: "slide-out-right 200ms {easings.emphasized-out}" },
|
|
18
|
+
"drawer-in-bottom": { value: "slide-in-bottom 400ms {easings.emphasized-in}" },
|
|
19
|
+
"drawer-out-bottom": { value: "slide-out-bottom 200ms {easings.emphasized-out}" },
|
|
20
|
+
"drawer-in-top": { value: "slide-in-top 400ms {easings.emphasized-in}" },
|
|
21
|
+
"drawer-out-top": { value: "slide-out-top 200ms {easings.emphasized-out}" },
|
|
22
|
+
"skeleton-pulse": { value: "skeleton-pulse 2s {easings.pulse} infinite" }
|
|
65
23
|
});
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
value: "cubic-bezier(0.05, 0.7, 0.1, 1.0)"
|
|
72
|
-
},
|
|
73
|
-
"emphasized-out": {
|
|
74
|
-
value: "cubic-bezier(0.3, 0.0, 0.8, 0.15)"
|
|
75
|
-
},
|
|
76
|
-
pulse: {
|
|
77
|
-
value: "cubic-bezier(0.4, 0.0, 0.6, 1.0)"
|
|
78
|
-
}
|
|
24
|
+
const easings = defineTokens.easings({
|
|
25
|
+
default: { value: "cubic-bezier(0.17, 0.04, 0.03, 0.94)" },
|
|
26
|
+
"emphasized-in": { value: "cubic-bezier(0.05, 0.7, 0.1, 1.0)" },
|
|
27
|
+
"emphasized-out": { value: "cubic-bezier(0.3, 0.0, 0.8, 0.15)" },
|
|
28
|
+
pulse: { value: "cubic-bezier(0.4, 0.0, 0.6, 1.0)" }
|
|
79
29
|
});
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
},
|
|
87
|
-
normal: {
|
|
88
|
-
value: "400ms"
|
|
89
|
-
},
|
|
90
|
-
slow: {
|
|
91
|
-
value: "600ms"
|
|
92
|
-
},
|
|
93
|
-
infinite: {
|
|
94
|
-
value: "infinite"
|
|
95
|
-
}
|
|
30
|
+
const durations = defineTokens.durations({
|
|
31
|
+
superFast: { value: "100ms" },
|
|
32
|
+
fast: { value: "200ms" },
|
|
33
|
+
normal: { value: "400ms" },
|
|
34
|
+
slow: { value: "600ms" },
|
|
35
|
+
infinite: { value: "infinite" }
|
|
96
36
|
});
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
transform: "translateX(100%)"
|
|
177
|
-
},
|
|
178
|
-
"100%": {
|
|
179
|
-
transform: "translateX(0%)"
|
|
180
|
-
}
|
|
181
|
-
},
|
|
182
|
-
"slide-out-right": {
|
|
183
|
-
"0%": {
|
|
184
|
-
transform: "translateX(0%)"
|
|
185
|
-
},
|
|
186
|
-
"100%": {
|
|
187
|
-
transform: "translateX(100%)"
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
"slide-in-top": {
|
|
191
|
-
"0%": {
|
|
192
|
-
transform: "translateY(-100%)"
|
|
193
|
-
},
|
|
194
|
-
"100%": {
|
|
195
|
-
transform: "translateY(0%)"
|
|
196
|
-
}
|
|
197
|
-
},
|
|
198
|
-
"slide-out-top": {
|
|
199
|
-
"0%": {
|
|
200
|
-
transform: "translateY(0%)"
|
|
201
|
-
},
|
|
202
|
-
"100%": {
|
|
203
|
-
transform: "translateY(-100%)"
|
|
204
|
-
}
|
|
205
|
-
},
|
|
206
|
-
"slide-in-bottom": {
|
|
207
|
-
"0%": {
|
|
208
|
-
transform: "translateY(100%)"
|
|
209
|
-
},
|
|
210
|
-
"100%": {
|
|
211
|
-
transform: "translateY(0%)"
|
|
212
|
-
}
|
|
213
|
-
},
|
|
214
|
-
"slide-out-bottom": {
|
|
215
|
-
"0%": {
|
|
216
|
-
transform: "translateY(0%)"
|
|
217
|
-
},
|
|
218
|
-
"100%": {
|
|
219
|
-
transform: "translateY(100%)"
|
|
220
|
-
}
|
|
221
|
-
},
|
|
222
|
-
"skeleton-pulse": {
|
|
223
|
-
"50%": {
|
|
224
|
-
opacity: "0.5"
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
};
|
|
37
|
+
const keyframes = {
|
|
38
|
+
spin: {
|
|
39
|
+
from: { transform: "rotate(0deg)" },
|
|
40
|
+
to: { transform: "rotate(360deg)" }
|
|
41
|
+
},
|
|
42
|
+
"fade-shift-in": {
|
|
43
|
+
"0%": {
|
|
44
|
+
opacity: "0",
|
|
45
|
+
transform: "translateY(-4px)"
|
|
46
|
+
},
|
|
47
|
+
"100%": {
|
|
48
|
+
opacity: "1",
|
|
49
|
+
transform: "translateY(0)"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"fade-shift-out": {
|
|
53
|
+
"0%": {
|
|
54
|
+
opacity: "1",
|
|
55
|
+
transform: "translateY(0)"
|
|
56
|
+
},
|
|
57
|
+
"100%": {
|
|
58
|
+
opacity: "0",
|
|
59
|
+
transform: "translateY(-4px)"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"collapse-in": {
|
|
63
|
+
"0%": { height: "0" },
|
|
64
|
+
"100%": { height: "var(--height)" }
|
|
65
|
+
},
|
|
66
|
+
"collapse-out": {
|
|
67
|
+
"0%": { height: "var(--height)" },
|
|
68
|
+
"100%": { height: "0" }
|
|
69
|
+
},
|
|
70
|
+
"fade-in": {
|
|
71
|
+
from: { opacity: "0" },
|
|
72
|
+
to: { opacity: "1" }
|
|
73
|
+
},
|
|
74
|
+
"fade-out": {
|
|
75
|
+
from: { opacity: "1" },
|
|
76
|
+
to: { opacity: "0" }
|
|
77
|
+
},
|
|
78
|
+
"slide-in-left": {
|
|
79
|
+
"0%": { transform: "translateX(-100%)" },
|
|
80
|
+
"100%": { transform: "translateX(0%)" }
|
|
81
|
+
},
|
|
82
|
+
"slide-out-left": {
|
|
83
|
+
"0%": { transform: "translateX(0%)" },
|
|
84
|
+
"100%": { transform: "translateX(-100%)" }
|
|
85
|
+
},
|
|
86
|
+
"slide-in-right": {
|
|
87
|
+
"0%": { transform: "translateX(100%)" },
|
|
88
|
+
"100%": { transform: "translateX(0%)" }
|
|
89
|
+
},
|
|
90
|
+
"slide-out-right": {
|
|
91
|
+
"0%": { transform: "translateX(0%)" },
|
|
92
|
+
"100%": { transform: "translateX(100%)" }
|
|
93
|
+
},
|
|
94
|
+
"slide-in-top": {
|
|
95
|
+
"0%": { transform: "translateY(-100%)" },
|
|
96
|
+
"100%": { transform: "translateY(0%)" }
|
|
97
|
+
},
|
|
98
|
+
"slide-out-top": {
|
|
99
|
+
"0%": { transform: "translateY(0%)" },
|
|
100
|
+
"100%": { transform: "translateY(-100%)" }
|
|
101
|
+
},
|
|
102
|
+
"slide-in-bottom": {
|
|
103
|
+
"0%": { transform: "translateY(100%)" },
|
|
104
|
+
"100%": { transform: "translateY(0%)" }
|
|
105
|
+
},
|
|
106
|
+
"slide-out-bottom": {
|
|
107
|
+
"0%": { transform: "translateY(0%)" },
|
|
108
|
+
"100%": { transform: "translateY(100%)" }
|
|
109
|
+
},
|
|
110
|
+
"skeleton-pulse": { "50%": { opacity: "0.5" } }
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
//#endregion
|
|
114
|
+
export { animations, durations, easings, keyframes };
|
|
115
|
+
//# sourceMappingURL=animations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animations.js","names":[],"sources":["../src/animations.ts"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { defineTokens } from \"@pandacss/dev\";\n\nexport const animations = defineTokens.animations({\n spin: {\n value: \"spin 700ms infinite linear\",\n },\n \"collapse-in\": {\n value: \"collapse-in 250ms {easings.emphasized-in}\",\n },\n \"collapse-out\": {\n value: \"collapse-out 200ms {easings.emphasized-out}\",\n },\n \"fade-shift-in\": {\n value: \"fade-shift-in 200ms {easings.emphasized-in}\",\n },\n \"fade-shift-out\": {\n value: \"fade-shift-in 200ms {easings.emphasized-in}\",\n },\n \"backdrop-in\": {\n value: \"fade-in 250ms {easings.emphasized-in}\",\n },\n \"backdrop-out\": {\n value: \"fade-out 200ms {easings.emphasized-out}\",\n },\n \"dialog-in\": {\n value: \"fade-in 400ms {easings.emphasized-in}\",\n },\n \"dialog-out\": {\n value: \"fade-out 200ms {easings.emphasized-out}\",\n },\n \"drawer-in-left\": {\n value: \"slide-in-left 400ms {easings.emphasized-in}\",\n },\n \"drawer-out-left\": {\n value: \"slide-out-left 200ms {easings.emphasized-out}\",\n },\n \"drawer-in-right\": {\n value: \"slide-in-right 400ms {easings.emphasized-in}\",\n },\n \"drawer-out-right\": {\n value: \"slide-out-right 200ms {easings.emphasized-out}\",\n },\n \"drawer-in-bottom\": {\n value: \"slide-in-bottom 400ms {easings.emphasized-in}\",\n },\n \"drawer-out-bottom\": {\n value: \"slide-out-bottom 200ms {easings.emphasized-out}\",\n },\n \"drawer-in-top\": {\n value: \"slide-in-top 400ms {easings.emphasized-in}\",\n },\n \"drawer-out-top\": {\n value: \"slide-out-top 200ms {easings.emphasized-out}\",\n },\n \"skeleton-pulse\": {\n value: \"skeleton-pulse 2s {easings.pulse} infinite\",\n },\n});\n\nexport const easings = defineTokens.easings({\n default: { value: \"cubic-bezier(0.17, 0.04, 0.03, 0.94)\" },\n \"emphasized-in\": { value: \"cubic-bezier(0.05, 0.7, 0.1, 1.0)\" },\n \"emphasized-out\": { value: \"cubic-bezier(0.3, 0.0, 0.8, 0.15)\" },\n pulse: { value: \"cubic-bezier(0.4, 0.0, 0.6, 1.0)\" },\n});\n\nexport const durations = defineTokens.durations({\n superFast: { value: \"100ms\" },\n fast: { value: \"200ms\" },\n normal: { value: \"400ms\" },\n slow: { value: \"600ms\" },\n infinite: { value: \"infinite\" },\n});\n\nexport const keyframes = {\n spin: {\n from: { transform: \"rotate(0deg)\" },\n to: { transform: \"rotate(360deg)\" },\n },\n \"fade-shift-in\": {\n \"0%\": { opacity: \"0\", transform: \"translateY(-4px)\" },\n \"100%\": { opacity: \"1\", transform: \"translateY(0)\" },\n },\n \"fade-shift-out\": {\n \"0%\": { opacity: \"1\", transform: \"translateY(0)\" },\n \"100%\": { opacity: \"0\", transform: \"translateY(-4px)\" },\n },\n \"collapse-in\": {\n \"0%\": { height: \"0\" },\n \"100%\": { height: \"var(--height)\" },\n },\n \"collapse-out\": {\n \"0%\": { height: \"var(--height)\" },\n \"100%\": { height: \"0\" },\n },\n \"fade-in\": {\n from: { opacity: \"0\" },\n to: { opacity: \"1\" },\n },\n \"fade-out\": {\n from: { opacity: \"1\" },\n to: { opacity: \"0\" },\n },\n \"slide-in-left\": {\n \"0%\": { transform: \"translateX(-100%)\" },\n \"100%\": { transform: \"translateX(0%)\" },\n },\n \"slide-out-left\": {\n \"0%\": { transform: \"translateX(0%)\" },\n \"100%\": { transform: \"translateX(-100%)\" },\n },\n \"slide-in-right\": {\n \"0%\": { transform: \"translateX(100%)\" },\n \"100%\": { transform: \"translateX(0%)\" },\n },\n \"slide-out-right\": {\n \"0%\": { transform: \"translateX(0%)\" },\n \"100%\": { transform: \"translateX(100%)\" },\n },\n \"slide-in-top\": {\n \"0%\": { transform: \"translateY(-100%)\" },\n \"100%\": { transform: \"translateY(0%)\" },\n },\n \"slide-out-top\": {\n \"0%\": { transform: \"translateY(0%)\" },\n \"100%\": { transform: \"translateY(-100%)\" },\n },\n \"slide-in-bottom\": {\n \"0%\": { transform: \"translateY(100%)\" },\n \"100%\": { transform: \"translateY(0%)\" },\n },\n \"slide-out-bottom\": {\n \"0%\": { transform: \"translateY(0%)\" },\n \"100%\": { transform: \"translateY(100%)\" },\n },\n \"skeleton-pulse\": {\n \"50%\": { opacity: \"0.5\" },\n },\n};\n"],"mappings":"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"}
|
package/es/boxShadows.js
CHANGED
|
@@ -1,38 +1,34 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2024-present, NDLA.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
1
|
import { defineTokens } from "@pandacss/dev";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
});
|
|
2
|
+
|
|
3
|
+
//#region src/boxShadows.ts
|
|
4
|
+
const boxShadows = defineTokens.shadows({
|
|
5
|
+
xsmall: { value: ["0px 1px 4px 0px rgba(0, 0, 0, 0.15)", "0px 0px 1px 0px rgba(0, 0, 0, 0.18)"] },
|
|
6
|
+
small: { value: [
|
|
7
|
+
"0px 3px 8px 0px rgba(0, 0, 0, 0.1)",
|
|
8
|
+
"0px 1px 3px 0px rgba(0, 0, 0, 0.1)",
|
|
9
|
+
"0px 0px 1px 0px rgba(0, 0, 0, 0.18)"
|
|
10
|
+
] },
|
|
11
|
+
medium: { value: [
|
|
12
|
+
"0px 5px 12px 0px rgba(0, 0, 0, 0.13)",
|
|
13
|
+
"0px 1px 3px 0px rgba(0, 0, 0, 0.1)",
|
|
14
|
+
"0px 0px 1px 0px rgba(0, 0, 0, 0.15)"
|
|
15
|
+
] },
|
|
16
|
+
large: { value: [
|
|
17
|
+
"0px 10px 16px 0px rgba(0, 0, 0, 0.12)",
|
|
18
|
+
"0px 2px 5px 0px rgba(0, 0, 0, 0.15)",
|
|
19
|
+
"0px 0px 1px 0px rgba(0, 0, 0, 0.12)"
|
|
20
|
+
] },
|
|
21
|
+
xlarge: { value: [
|
|
22
|
+
"0px 10px 24px 0px rgba(0, 0, 0, 0.18)",
|
|
23
|
+
"0px 2px 5px 0px rgba(0, 0, 0, 0.15)",
|
|
24
|
+
"0px 0px 1px 0px rgba(0, 0, 0, 0.08)"
|
|
25
|
+
] },
|
|
26
|
+
full: { value: "4px 4px 0px 0px {colors.primary}" },
|
|
27
|
+
inner: { value: `0px -1px 0px 0px rgba(45, 27, 98, 0.25) inset` },
|
|
28
|
+
innerTop: { value: "0px 1px 0px 0px rgba(45, 27, 98, 0.25) inset" },
|
|
29
|
+
innerRight: { value: "-1px 0px 0px 0px rgba(45, 27, 98, 0.25) inset" }
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { boxShadows };
|
|
34
|
+
//# sourceMappingURL=boxShadows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boxShadows.js","names":[],"sources":["../src/boxShadows.ts"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { defineTokens } from \"@pandacss/dev\";\n\nexport const boxShadows = defineTokens.shadows({\n xsmall: { value: [\"0px 1px 4px 0px rgba(0, 0, 0, 0.15)\", \"0px 0px 1px 0px rgba(0, 0, 0, 0.18)\"] },\n small: {\n value: [\n \"0px 3px 8px 0px rgba(0, 0, 0, 0.1)\",\n \"0px 1px 3px 0px rgba(0, 0, 0, 0.1)\",\n \"0px 0px 1px 0px rgba(0, 0, 0, 0.18)\",\n ],\n },\n medium: {\n value: [\n \"0px 5px 12px 0px rgba(0, 0, 0, 0.13)\",\n \"0px 1px 3px 0px rgba(0, 0, 0, 0.1)\",\n \"0px 0px 1px 0px rgba(0, 0, 0, 0.15)\",\n ],\n },\n large: {\n value: [\n \"0px 10px 16px 0px rgba(0, 0, 0, 0.12)\",\n \"0px 2px 5px 0px rgba(0, 0, 0, 0.15)\",\n \"0px 0px 1px 0px rgba(0, 0, 0, 0.12)\",\n ],\n },\n xlarge: {\n value: [\n \"0px 10px 24px 0px rgba(0, 0, 0, 0.18)\",\n \"0px 2px 5px 0px rgba(0, 0, 0, 0.15)\",\n \"0px 0px 1px 0px rgba(0, 0, 0, 0.08)\",\n ],\n },\n full: {\n value: \"4px 4px 0px 0px {colors.primary}\",\n },\n inner: {\n value: `0px -1px 0px 0px rgba(45, 27, 98, 0.25) inset`, //colors.primary\n },\n innerTop: {\n value: \"0px 1px 0px 0px rgba(45, 27, 98, 0.25) inset\", //colors.primary\n },\n innerRight: {\n value: \"-1px 0px 0px 0px rgba(45, 27, 98, 0.25) inset\", //colors.primary\n },\n});\n"],"mappings":";;;AAUA,MAAa,aAAa,aAAa,QAAQ;CAC7C,QAAQ,EAAE,OAAO,CAAC,uCAAuC,qCAAsC,EAAE;CACjG,OAAO,EACL,OAAO;EACL;EACA;EACA;CACD,EACF;CACD,QAAQ,EACN,OAAO;EACL;EACA;EACA;CACD,EACF;CACD,OAAO,EACL,OAAO;EACL;EACA;EACA;CACD,EACF;CACD,QAAQ,EACN,OAAO;EACL;EACA;EACA;CACD,EACF;CACD,MAAM,EACJ,OAAO,mCACR;CACD,OAAO,EACL,QAAQ,+CACT;CACD,UAAU,EACR,OAAO,+CACR;CACD,YAAY,EACV,OAAO,gDACR;AACF,EAAC"}
|