@danielito1996/compose-svelted 0.0.1 → 0.2.0
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 +113 -274
- package/dist/components/ContentScale.d.ts +10 -0
- package/dist/components/layouts/Alignment.d.ts +20 -0
- package/dist/components/layouts/Arrangement.d.ts +23 -0
- package/{src/lib/components/textFields/TextFieldColors.ts → dist/components/textFields/TextFieldColors.d.ts} +12 -11
- package/dist/components/textFields/TextFieldDefaults.d.ts +11 -0
- package/dist/core/elevation/elevation.d.ts +1 -0
- package/dist/core/helpers/painterResource.d.ts +12 -0
- package/{src/lib/core/modifier/Modifier.ts → dist/core/modifier/Modifier.d.ts} +195 -259
- package/dist/core/modifier/ModifierImpl.d.ts +38 -0
- package/dist/core/motion/AnimationSpec.d.ts +6 -0
- package/dist/core/motion/ContentTransition.d.ts +5 -0
- package/dist/core/motion/contentTransitions.d.ts +4 -0
- package/dist/core/motion/transitions.d.ts +7 -0
- package/dist/core/navigation/NavBackStackEntry.d.ts +4 -0
- package/dist/core/navigation/NavController.d.ts +8 -0
- package/dist/core/navigation/NavStore.d.ts +6 -0
- package/dist/core/navigation/Route.d.ts +3 -0
- package/dist/core/navigation/composable.d.ts +5 -0
- package/dist/core/navigation/rememberNavController.d.ts +2 -0
- package/dist/core/shapes/RoundedCornerShape.d.ts +13 -0
- package/{src/lib/core/shapes/Shape.ts → dist/core/shapes/Shape.d.ts} +3 -3
- package/dist/core/theme/ColorScheme.d.ts +17 -0
- package/dist/core/theme/Density.d.ts +5 -0
- package/dist/core/theme/TextStyle.d.ts +19 -0
- package/{src/lib/core/theme/colors.ts → dist/core/theme/colors.d.ts} +15 -21
- package/dist/core/theme/cssVars.d.ts +2 -0
- package/dist/core/theme/defaults/darkColors.d.ts +2 -0
- package/dist/core/theme/defaults/defaultTheme.d.ts +3 -0
- package/dist/core/theme/defaults/lightColors.d.ts +2 -0
- package/dist/core/theme/defaults/typography.d.ts +2 -0
- package/{src/lib/core/theme/elevation.ts → dist/core/theme/elevation.d.ts} +7 -7
- package/dist/core/theme/getCurrentColor.d.ts +1 -0
- package/dist/core/theme/resolve.d.ts +5 -0
- package/{src/lib/core/theme/shapes.ts → dist/core/theme/shapes.d.ts} +7 -7
- package/{src/lib/core/theme/spacing.ts → dist/core/theme/spacing.d.ts} +7 -7
- package/dist/core/theme/store.d.ts +2 -0
- package/dist/core/theme/systemTheme.d.ts +2 -0
- package/{src/lib/core/theme/theme.ts → dist/core/theme/theme.d.ts} +13 -15
- package/{src/lib/core/theme/typography.ts → dist/core/theme/typography.d.ts} +24 -29
- package/dist/index.d.ts +152 -0
- package/dist/index.js +1164 -0
- package/package.json +9 -35
- package/.vscode/extensions.json +0 -3
- package/docs/assets/components/button/button.png +0 -0
- package/docs/assets/components/surface/surface_simple.png +0 -0
- package/docs/assets/components/text/text.png +0 -0
- package/docs/assets/components/textfield/textfield_simple.png +0 -0
- package/docs/assets/svelted.png +0 -0
- package/docs/assets/svelted.svg +0 -41
- package/docs/getting_started.md +0 -116
- package/docs/index.md +0 -106
- package/index.html +0 -14
- package/screenshots/Captura de pantalla 2025-12-20 022710.png +0 -0
- package/screenshots/capturas.txt +0 -1
- package/src/App.svelte +0 -39
- package/src/app.css +0 -23
- package/src/assets/img/hav3m.png +0 -0
- package/src/assets/img/vessel.jpg +0 -0
- package/src/assets/raw/boat.svg +0 -15
- package/src/assets/raw/cash.svg +0 -39
- package/src/assets/raw/police.json +0 -1
- package/src/assets/raw/svelte.svg +0 -1
- package/src/lib/Counter.svelte +0 -10
- package/src/lib/components/AppRoot.svelte +0 -15
- package/src/lib/components/ContentScale.ts +0 -12
- package/src/lib/components/Icon.svelte +0 -47
- package/src/lib/components/Image.svelte +0 -31
- package/src/lib/components/Spacer.svelte +0 -11
- package/src/lib/components/Surface.svelte +0 -19
- package/src/lib/components/Text.svelte +0 -23
- package/src/lib/components/TonalButton.svelte +0 -34
- package/src/lib/components/buttons/Button.svelte +0 -34
- package/src/lib/components/buttons/IconButton.svelte +0 -0
- package/src/lib/components/buttons/OutlinedButton.svelte +0 -0
- package/src/lib/components/buttons/OutlinedButtonWithIcon.svelte +0 -0
- package/src/lib/components/buttons/OutlinedIconButton.svelte +0 -0
- package/src/lib/components/buttons/TextButton.svelte +0 -0
- package/src/lib/components/cards/Card.svelte +0 -0
- package/src/lib/components/cards/OutlinedCard.svelte +0 -0
- package/src/lib/components/layouts/Alignment.ts +0 -37
- package/src/lib/components/layouts/Arrangement.ts +0 -66
- package/src/lib/components/layouts/Box.svelte +0 -25
- package/src/lib/components/layouts/Column.svelte +0 -23
- package/src/lib/components/layouts/LazyColumn.svelte +0 -0
- package/src/lib/components/layouts/LazyRow.svelte +0 -0
- package/src/lib/components/layouts/Row.svelte +0 -23
- package/src/lib/components/layouts/Scafold.svelte +0 -0
- package/src/lib/components/menus/DropdownMenu.svelte +0 -0
- package/src/lib/components/menus/DropdownMenuItem.svelte +0 -0
- package/src/lib/components/textFields/BaseTextField.svelte +0 -130
- package/src/lib/components/textFields/OutlinedTextField.svelte +0 -52
- package/src/lib/components/textFields/TextField.svelte +0 -36
- package/src/lib/components/textFields/TextFieldDefaults.ts +0 -48
- package/src/lib/core/helpers/painterResource.ts +0 -26
- package/src/lib/core/modifier/ModifierImpl.ts +0 -275
- package/src/lib/core/shapes/RoundedCornerShape.ts +0 -53
- package/src/lib/core/theme/ColorScheme.ts +0 -25
- package/src/lib/core/theme/ComposeTheme.svelte +0 -22
- package/src/lib/core/theme/TextStyle.ts +0 -25
- package/src/lib/core/theme/cssVars.ts +0 -32
- package/src/lib/core/theme/defaults/darkColors.ts +0 -17
- package/src/lib/core/theme/defaults/defaultTheme.ts +0 -35
- package/src/lib/core/theme/defaults/lightColors.ts +0 -17
- package/src/lib/core/theme/defaults/typography.ts +0 -128
- package/src/lib/core/theme/getCurrentColor.ts +0 -10
- package/src/lib/core/theme/resolve.ts +0 -29
- package/src/lib/core/theme/store.ts +0 -26
- package/src/lib/core/theme/systemTheme.ts +0 -20
- package/src/lib/index.ts +0 -42
- package/src/main.ts +0 -9
- package/svelte.config.js +0 -8
- package/tsconfig.app.json +0 -21
- package/tsconfig.json +0 -7
- package/tsconfig.node.json +0 -26
- package/vite.config.ts +0 -11
- /package/{src/lib/components/buttons/ButtonWithIcon.svelte → dist/core/motion/applyAnimation.d.ts} +0 -0
- /package/{public → dist}/vite.svg +0 -0
|
@@ -1,259 +1,195 @@
|
|
|
1
|
-
import { ModifierImpl } from "./ModifierImpl";
|
|
2
|
-
import type {BoxAlignment} from "../../components/layouts/Alignment";
|
|
3
|
-
import type {Shape} from "../shapes/Shape";
|
|
4
|
-
import type {ColorToken} from "../theme/ColorScheme";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
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
|
-
*
|
|
39
|
-
*
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
*
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
* ```
|
|
197
|
-
*/
|
|
198
|
-
background(color: ColorToken | string): ModifierImpl {
|
|
199
|
-
return new ModifierImpl().background(color);
|
|
200
|
-
},
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* Assigns a proportional weight to the component inside
|
|
204
|
-
* a Row or Column.
|
|
205
|
-
*
|
|
206
|
-
* Similar to flex-grow.
|
|
207
|
-
*
|
|
208
|
-
* Example:
|
|
209
|
-
* ```
|
|
210
|
-
* Modifier.weight(1)
|
|
211
|
-
* ```
|
|
212
|
-
*/
|
|
213
|
-
weight(weight: number, fill: boolean = true): ModifierImpl {
|
|
214
|
-
return new ModifierImpl().weight(weight, fill);
|
|
215
|
-
},
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Assigns weight without forcing fill behavior.
|
|
219
|
-
*/
|
|
220
|
-
weightNoFill(weight: number): ModifierImpl {
|
|
221
|
-
return this.weight(weight, false);
|
|
222
|
-
},
|
|
223
|
-
|
|
224
|
-
/**
|
|
225
|
-
* Adds top margin to the component.
|
|
226
|
-
*/
|
|
227
|
-
marginTop(value: number, unit = 'px'): ModifierImpl {
|
|
228
|
-
return new ModifierImpl().marginTop(value, unit);
|
|
229
|
-
},
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* Clips the component using the provided Shape.
|
|
233
|
-
*
|
|
234
|
-
* Example:
|
|
235
|
-
* ```
|
|
236
|
-
* Modifier.clip(RoundedCornerShape(16))
|
|
237
|
-
* ```
|
|
238
|
-
*/
|
|
239
|
-
clip(shape: Shape): ModifierImpl {
|
|
240
|
-
return new ModifierImpl().clip(shape);
|
|
241
|
-
},
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* Sets both width and height to the same value.
|
|
245
|
-
*
|
|
246
|
-
* Useful for icons and square components.
|
|
247
|
-
*
|
|
248
|
-
* Example:
|
|
249
|
-
* ```
|
|
250
|
-
* Modifier.size(24)
|
|
251
|
-
* ```
|
|
252
|
-
*/
|
|
253
|
-
size(value: number | string, unit: string = "px"): ModifierImpl {
|
|
254
|
-
return new ModifierImpl().size(value, unit);
|
|
255
|
-
}
|
|
256
|
-
} as const;
|
|
257
|
-
|
|
258
|
-
// Tipo público
|
|
259
|
-
export type Modifier = ModifierImpl;
|
|
1
|
+
import { ModifierImpl } from "./ModifierImpl";
|
|
2
|
+
import type { BoxAlignment } from "../../components/layouts/Alignment";
|
|
3
|
+
import type { Shape } from "../shapes/Shape";
|
|
4
|
+
import type { ColorToken } from "../theme/ColorScheme";
|
|
5
|
+
/**
|
|
6
|
+
* Modifier
|
|
7
|
+
*
|
|
8
|
+
* Modifier is an immutable, chainable object used to decorate or augment
|
|
9
|
+
* a UI component.
|
|
10
|
+
*
|
|
11
|
+
* Inspired by Jetpack Compose Modifier.
|
|
12
|
+
*
|
|
13
|
+
* Usage:
|
|
14
|
+
* ```
|
|
15
|
+
* Modifier
|
|
16
|
+
* .padding(16)
|
|
17
|
+
* .fillMaxWidth()
|
|
18
|
+
* .background(ColorScheme.Surface)
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare const Modifier: {
|
|
22
|
+
/**
|
|
23
|
+
* Returns an empty Modifier with no effects.
|
|
24
|
+
*
|
|
25
|
+
* Useful as a default value or starting point.
|
|
26
|
+
*/
|
|
27
|
+
readonly empty: () => ModifierImpl;
|
|
28
|
+
/**
|
|
29
|
+
* Adds padding around the content.
|
|
30
|
+
*
|
|
31
|
+
* Can be used with:
|
|
32
|
+
* - a single number (uniform padding)
|
|
33
|
+
* - an object with directional values
|
|
34
|
+
*
|
|
35
|
+
* Examples:
|
|
36
|
+
* ```
|
|
37
|
+
* Modifier.padding(16)
|
|
38
|
+
* Modifier.padding({ top: 8, bottom: 8 })
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
readonly padding: (valueOrParams?: number | {
|
|
42
|
+
top?: number;
|
|
43
|
+
bottom?: number;
|
|
44
|
+
start?: number;
|
|
45
|
+
end?: number;
|
|
46
|
+
}, unit?: string) => ModifierImpl;
|
|
47
|
+
/**
|
|
48
|
+
* Adds horizontal padding (left and right).
|
|
49
|
+
*/
|
|
50
|
+
readonly paddingHorizontal: (value: number) => ModifierImpl;
|
|
51
|
+
/**
|
|
52
|
+
* Adds a border around the component.
|
|
53
|
+
*
|
|
54
|
+
* Optionally accepts a Shape to match rounded corners.
|
|
55
|
+
*
|
|
56
|
+
* Examples:
|
|
57
|
+
* ```
|
|
58
|
+
* Modifier.border(1, ColorScheme.Outline)
|
|
59
|
+
* Modifier.border(2, "#FF0000", RoundedCornerShape(12))
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
readonly border: (width: number, color: string, shape?: Shape) => ModifierImpl;
|
|
63
|
+
/**
|
|
64
|
+
* Marks the component as clickable.
|
|
65
|
+
*
|
|
66
|
+
* This modifier applies interaction semantics such as:
|
|
67
|
+
* - pointer cursor
|
|
68
|
+
* - user-select disabling
|
|
69
|
+
*
|
|
70
|
+
* Note:
|
|
71
|
+
* The click handler must still be attached at the component level.
|
|
72
|
+
*
|
|
73
|
+
* Example:
|
|
74
|
+
* ```
|
|
75
|
+
* <Box
|
|
76
|
+
* on:click={onClick}
|
|
77
|
+
* modifier={Modifier.clickable(onClick)}
|
|
78
|
+
* />
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
readonly clickable: (onClick: () => void) => ModifierImpl;
|
|
82
|
+
/**
|
|
83
|
+
* Offsets the component visually without affecting its layout.
|
|
84
|
+
*
|
|
85
|
+
* Equivalent to Jetpack Compose Modifier.offset.
|
|
86
|
+
*
|
|
87
|
+
* Note:
|
|
88
|
+
* This uses CSS transform and does not affect surrounding layout.
|
|
89
|
+
*/
|
|
90
|
+
readonly offset: (x: number, y: number) => ModifierImpl;
|
|
91
|
+
/**
|
|
92
|
+
* Enables vertical scrolling for the component.
|
|
93
|
+
*
|
|
94
|
+
* Useful for Column or large content containers.
|
|
95
|
+
*/
|
|
96
|
+
readonly verticalScroll: (enabled?: boolean) => ModifierImpl;
|
|
97
|
+
/**
|
|
98
|
+
* Enables horizontal scrolling for the component.
|
|
99
|
+
*/
|
|
100
|
+
readonly horizontalScroll: (enabled?: boolean) => ModifierImpl;
|
|
101
|
+
/**
|
|
102
|
+
* Adds vertical padding (top and bottom).
|
|
103
|
+
*/
|
|
104
|
+
readonly paddingVertical: (value: number) => ModifierImpl;
|
|
105
|
+
/**
|
|
106
|
+
* Aligns the component inside a Box.
|
|
107
|
+
*
|
|
108
|
+
* ⚠️ This modifier is intended to be used only inside Box layouts.
|
|
109
|
+
*
|
|
110
|
+
* Example:
|
|
111
|
+
* ```
|
|
112
|
+
* Modifier.align(Alignment.Center)
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
readonly align: (alignment: BoxAlignment) => ModifierImpl;
|
|
116
|
+
/**
|
|
117
|
+
* Makes the component fill the maximum available width.
|
|
118
|
+
*/
|
|
119
|
+
readonly fillMaxWidth: () => ModifierImpl;
|
|
120
|
+
/**
|
|
121
|
+
* Makes the component fill the maximum available height.
|
|
122
|
+
*/
|
|
123
|
+
readonly fillMaxHeight: () => ModifierImpl;
|
|
124
|
+
/**
|
|
125
|
+
* Makes the component fill both width and height.
|
|
126
|
+
*/
|
|
127
|
+
readonly fillMaxSize: () => ModifierImpl;
|
|
128
|
+
/**
|
|
129
|
+
* Sets a fixed height for the component.
|
|
130
|
+
*
|
|
131
|
+
* Accepts either a number (px by default) or a CSS size string.
|
|
132
|
+
*/
|
|
133
|
+
readonly height: (value: number | string, unit?: string) => ModifierImpl;
|
|
134
|
+
/**
|
|
135
|
+
* Sets a fixed width for the component.
|
|
136
|
+
*
|
|
137
|
+
* Accepts either a number (px by default) or a CSS size string.
|
|
138
|
+
*/
|
|
139
|
+
readonly width: (value: number | string, unit?: string) => ModifierImpl;
|
|
140
|
+
/**
|
|
141
|
+
* Applies a background color to the component.
|
|
142
|
+
*
|
|
143
|
+
* Accepts either:
|
|
144
|
+
* - A CSS color string (e.g. "#2A2A2A", "transparent")
|
|
145
|
+
* - A Compose color token (e.g. ColorScheme.Surface)
|
|
146
|
+
*
|
|
147
|
+
* Examples:
|
|
148
|
+
* ```
|
|
149
|
+
* Modifier.background(ColorScheme.Surface)
|
|
150
|
+
* Modifier.background("#121212")
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
readonly background: (color: ColorToken | string) => ModifierImpl;
|
|
154
|
+
/**
|
|
155
|
+
* Assigns a proportional weight to the component inside
|
|
156
|
+
* a Row or Column.
|
|
157
|
+
*
|
|
158
|
+
* Similar to flex-grow.
|
|
159
|
+
*
|
|
160
|
+
* Example:
|
|
161
|
+
* ```
|
|
162
|
+
* Modifier.weight(1)
|
|
163
|
+
* ```
|
|
164
|
+
*/
|
|
165
|
+
readonly weight: (weight: number, fill?: boolean) => ModifierImpl;
|
|
166
|
+
/**
|
|
167
|
+
* Assigns weight without forcing fill behavior.
|
|
168
|
+
*/
|
|
169
|
+
readonly weightNoFill: (weight: number) => ModifierImpl;
|
|
170
|
+
/**
|
|
171
|
+
* Adds top margin to the component.
|
|
172
|
+
*/
|
|
173
|
+
readonly marginTop: (value: number, unit?: string) => ModifierImpl;
|
|
174
|
+
/**
|
|
175
|
+
* Clips the component using the provided Shape.
|
|
176
|
+
*
|
|
177
|
+
* Example:
|
|
178
|
+
* ```
|
|
179
|
+
* Modifier.clip(RoundedCornerShape(16))
|
|
180
|
+
* ```
|
|
181
|
+
*/
|
|
182
|
+
readonly clip: (shape: Shape) => ModifierImpl;
|
|
183
|
+
/**
|
|
184
|
+
* Sets both width and height to the same value.
|
|
185
|
+
*
|
|
186
|
+
* Useful for icons and square components.
|
|
187
|
+
*
|
|
188
|
+
* Example:
|
|
189
|
+
* ```
|
|
190
|
+
* Modifier.size(24)
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
readonly size: (value: number | string, unit?: string) => ModifierImpl;
|
|
194
|
+
};
|
|
195
|
+
export type Modifier = ModifierImpl;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { BoxAlignment } from "../../components/layouts/Alignment";
|
|
2
|
+
import type { Shape } from "../shapes/Shape";
|
|
3
|
+
import type { ColorToken } from "../theme/ColorScheme";
|
|
4
|
+
export type ModifierEntry = {
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare class ModifierImpl {
|
|
9
|
+
private readonly entries;
|
|
10
|
+
constructor(entries?: ModifierEntry[]);
|
|
11
|
+
then(other: ModifierImpl): ModifierImpl;
|
|
12
|
+
paddingHorizontal(value: number): ModifierImpl;
|
|
13
|
+
verticalScroll(enabled?: boolean): ModifierImpl;
|
|
14
|
+
horizontalScroll(enabled?: boolean): ModifierImpl;
|
|
15
|
+
paddingVertical(value: number): ModifierImpl;
|
|
16
|
+
fillMaxWidth(): ModifierImpl;
|
|
17
|
+
fillMaxHeight(): ModifierImpl;
|
|
18
|
+
fillMaxSize(): ModifierImpl;
|
|
19
|
+
background(color: ColorToken | string): ModifierImpl;
|
|
20
|
+
weight(weight: number, fill?: boolean): ModifierImpl;
|
|
21
|
+
align(alignment: BoxAlignment): ModifierImpl;
|
|
22
|
+
padding(valueOrParams?: number | {
|
|
23
|
+
top?: number;
|
|
24
|
+
bottom?: number;
|
|
25
|
+
start?: number;
|
|
26
|
+
end?: number;
|
|
27
|
+
}, unit?: string): ModifierImpl;
|
|
28
|
+
width(value: number | string, unit?: string): ModifierImpl;
|
|
29
|
+
height(value: number | string, unit?: string): ModifierImpl;
|
|
30
|
+
marginTop(value: number, unit?: string): ModifierImpl;
|
|
31
|
+
clip(shape: Shape): ModifierImpl;
|
|
32
|
+
size(value: number | string, unit?: string): ModifierImpl;
|
|
33
|
+
offset(x: number, y: number): ModifierImpl;
|
|
34
|
+
clickable(onClick: () => void): ModifierImpl;
|
|
35
|
+
border(width: number, color: string, shape?: Shape): ModifierImpl;
|
|
36
|
+
toStyle(): string;
|
|
37
|
+
toClass(): string;
|
|
38
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AnimationSpec } from "./AnimationSpec";
|
|
2
|
+
export declare function fadeIn(duration?: number): AnimationSpec;
|
|
3
|
+
export declare function fadeOut(duration?: number): AnimationSpec;
|
|
4
|
+
export declare function scaleIn(duration?: number): AnimationSpec;
|
|
5
|
+
export declare function scaleOut(duration?: number): AnimationSpec;
|
|
6
|
+
export declare function slideIn(duration?: number, direction?: "left" | "right" | "up" | "down"): AnimationSpec;
|
|
7
|
+
export declare function slideOut(duration?: number, direction?: "left" | "right" | "up" | "down"): AnimationSpec;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NavBackStackEntry } from "./NavBackStackEntry";
|
|
2
|
+
export declare class NavController {
|
|
3
|
+
private readonly stackStore;
|
|
4
|
+
constructor(startDestination: string);
|
|
5
|
+
_getStackStore(): Writable<NavBackStackEntry[]>;
|
|
6
|
+
navigate<T = unknown>(route: string, args?: T): void;
|
|
7
|
+
popBackStack(): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Shape } from "./Shape";
|
|
2
|
+
type CornerSize = number | string;
|
|
3
|
+
type RoundedCornerParams = CornerSize | {
|
|
4
|
+
topStart?: CornerSize;
|
|
5
|
+
topEnd?: CornerSize;
|
|
6
|
+
bottomEnd?: CornerSize;
|
|
7
|
+
bottomStart?: CornerSize;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Compose-like factory
|
|
11
|
+
*/
|
|
12
|
+
export declare function RoundedCornerShape(params: RoundedCornerParams): Shape;
|
|
13
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export interface Shape {
|
|
2
|
-
toCssBorderRadius(): string;
|
|
3
|
-
}
|
|
1
|
+
export interface Shape {
|
|
2
|
+
toCssBorderRadius(): string;
|
|
3
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ColorScheme as Def } from "./colors";
|
|
2
|
+
export type ColorToken = keyof Def;
|
|
3
|
+
export declare const ColorScheme: {
|
|
4
|
+
readonly Primary: "primary";
|
|
5
|
+
readonly OnPrimary: "onPrimary";
|
|
6
|
+
readonly Secondary: "secondary";
|
|
7
|
+
readonly OnSecondary: "onSecondary";
|
|
8
|
+
readonly Background: "background";
|
|
9
|
+
readonly OnBackground: "onBackground";
|
|
10
|
+
readonly Surface: "surface";
|
|
11
|
+
readonly OnSurface: "onSurface";
|
|
12
|
+
readonly SurfaceVariant: "surfaceVariant";
|
|
13
|
+
readonly OnSurfaceVariant: "onSurfaceVariant";
|
|
14
|
+
readonly Outline: "outline";
|
|
15
|
+
readonly Error: "error";
|
|
16
|
+
readonly OnError: "onError";
|
|
17
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Typography } from "./typography";
|
|
2
|
+
export type TextStyleToken = keyof Typography;
|
|
3
|
+
export declare const TextStyle: {
|
|
4
|
+
readonly DisplayLarge: "displayLarge";
|
|
5
|
+
readonly DisplayMedium: "displayMedium";
|
|
6
|
+
readonly DisplaySmall: "displaySmall";
|
|
7
|
+
readonly HeadlineLarge: "headlineLarge";
|
|
8
|
+
readonly HeadlineMedium: "headlineMedium";
|
|
9
|
+
readonly HeadlineSmall: "headlineSmall";
|
|
10
|
+
readonly TitleLarge: "titleLarge";
|
|
11
|
+
readonly TitleMedium: "titleMedium";
|
|
12
|
+
readonly TitleSmall: "titleSmall";
|
|
13
|
+
readonly BodyLarge: "bodyLarge";
|
|
14
|
+
readonly BodyMedium: "bodyMedium";
|
|
15
|
+
readonly BodySmall: "bodySmall";
|
|
16
|
+
readonly LabelLarge: "labelLarge";
|
|
17
|
+
readonly LabelMedium: "labelMedium";
|
|
18
|
+
readonly LabelSmall: "labelSmall";
|
|
19
|
+
};
|