@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.
Files changed (118) hide show
  1. package/README.md +113 -274
  2. package/dist/components/ContentScale.d.ts +10 -0
  3. package/dist/components/layouts/Alignment.d.ts +20 -0
  4. package/dist/components/layouts/Arrangement.d.ts +23 -0
  5. package/{src/lib/components/textFields/TextFieldColors.ts → dist/components/textFields/TextFieldColors.d.ts} +12 -11
  6. package/dist/components/textFields/TextFieldDefaults.d.ts +11 -0
  7. package/dist/core/elevation/elevation.d.ts +1 -0
  8. package/dist/core/helpers/painterResource.d.ts +12 -0
  9. package/{src/lib/core/modifier/Modifier.ts → dist/core/modifier/Modifier.d.ts} +195 -259
  10. package/dist/core/modifier/ModifierImpl.d.ts +38 -0
  11. package/dist/core/motion/AnimationSpec.d.ts +6 -0
  12. package/dist/core/motion/ContentTransition.d.ts +5 -0
  13. package/dist/core/motion/contentTransitions.d.ts +4 -0
  14. package/dist/core/motion/transitions.d.ts +7 -0
  15. package/dist/core/navigation/NavBackStackEntry.d.ts +4 -0
  16. package/dist/core/navigation/NavController.d.ts +8 -0
  17. package/dist/core/navigation/NavStore.d.ts +6 -0
  18. package/dist/core/navigation/Route.d.ts +3 -0
  19. package/dist/core/navigation/composable.d.ts +5 -0
  20. package/dist/core/navigation/rememberNavController.d.ts +2 -0
  21. package/dist/core/shapes/RoundedCornerShape.d.ts +13 -0
  22. package/{src/lib/core/shapes/Shape.ts → dist/core/shapes/Shape.d.ts} +3 -3
  23. package/dist/core/theme/ColorScheme.d.ts +17 -0
  24. package/dist/core/theme/Density.d.ts +5 -0
  25. package/dist/core/theme/TextStyle.d.ts +19 -0
  26. package/{src/lib/core/theme/colors.ts → dist/core/theme/colors.d.ts} +15 -21
  27. package/dist/core/theme/cssVars.d.ts +2 -0
  28. package/dist/core/theme/defaults/darkColors.d.ts +2 -0
  29. package/dist/core/theme/defaults/defaultTheme.d.ts +3 -0
  30. package/dist/core/theme/defaults/lightColors.d.ts +2 -0
  31. package/dist/core/theme/defaults/typography.d.ts +2 -0
  32. package/{src/lib/core/theme/elevation.ts → dist/core/theme/elevation.d.ts} +7 -7
  33. package/dist/core/theme/getCurrentColor.d.ts +1 -0
  34. package/dist/core/theme/resolve.d.ts +5 -0
  35. package/{src/lib/core/theme/shapes.ts → dist/core/theme/shapes.d.ts} +7 -7
  36. package/{src/lib/core/theme/spacing.ts → dist/core/theme/spacing.d.ts} +7 -7
  37. package/dist/core/theme/store.d.ts +2 -0
  38. package/dist/core/theme/systemTheme.d.ts +2 -0
  39. package/{src/lib/core/theme/theme.ts → dist/core/theme/theme.d.ts} +13 -15
  40. package/{src/lib/core/theme/typography.ts → dist/core/theme/typography.d.ts} +24 -29
  41. package/dist/index.d.ts +152 -0
  42. package/dist/index.js +1164 -0
  43. package/package.json +9 -35
  44. package/.vscode/extensions.json +0 -3
  45. package/docs/assets/components/button/button.png +0 -0
  46. package/docs/assets/components/surface/surface_simple.png +0 -0
  47. package/docs/assets/components/text/text.png +0 -0
  48. package/docs/assets/components/textfield/textfield_simple.png +0 -0
  49. package/docs/assets/svelted.png +0 -0
  50. package/docs/assets/svelted.svg +0 -41
  51. package/docs/getting_started.md +0 -116
  52. package/docs/index.md +0 -106
  53. package/index.html +0 -14
  54. package/screenshots/Captura de pantalla 2025-12-20 022710.png +0 -0
  55. package/screenshots/capturas.txt +0 -1
  56. package/src/App.svelte +0 -39
  57. package/src/app.css +0 -23
  58. package/src/assets/img/hav3m.png +0 -0
  59. package/src/assets/img/vessel.jpg +0 -0
  60. package/src/assets/raw/boat.svg +0 -15
  61. package/src/assets/raw/cash.svg +0 -39
  62. package/src/assets/raw/police.json +0 -1
  63. package/src/assets/raw/svelte.svg +0 -1
  64. package/src/lib/Counter.svelte +0 -10
  65. package/src/lib/components/AppRoot.svelte +0 -15
  66. package/src/lib/components/ContentScale.ts +0 -12
  67. package/src/lib/components/Icon.svelte +0 -47
  68. package/src/lib/components/Image.svelte +0 -31
  69. package/src/lib/components/Spacer.svelte +0 -11
  70. package/src/lib/components/Surface.svelte +0 -19
  71. package/src/lib/components/Text.svelte +0 -23
  72. package/src/lib/components/TonalButton.svelte +0 -34
  73. package/src/lib/components/buttons/Button.svelte +0 -34
  74. package/src/lib/components/buttons/IconButton.svelte +0 -0
  75. package/src/lib/components/buttons/OutlinedButton.svelte +0 -0
  76. package/src/lib/components/buttons/OutlinedButtonWithIcon.svelte +0 -0
  77. package/src/lib/components/buttons/OutlinedIconButton.svelte +0 -0
  78. package/src/lib/components/buttons/TextButton.svelte +0 -0
  79. package/src/lib/components/cards/Card.svelte +0 -0
  80. package/src/lib/components/cards/OutlinedCard.svelte +0 -0
  81. package/src/lib/components/layouts/Alignment.ts +0 -37
  82. package/src/lib/components/layouts/Arrangement.ts +0 -66
  83. package/src/lib/components/layouts/Box.svelte +0 -25
  84. package/src/lib/components/layouts/Column.svelte +0 -23
  85. package/src/lib/components/layouts/LazyColumn.svelte +0 -0
  86. package/src/lib/components/layouts/LazyRow.svelte +0 -0
  87. package/src/lib/components/layouts/Row.svelte +0 -23
  88. package/src/lib/components/layouts/Scafold.svelte +0 -0
  89. package/src/lib/components/menus/DropdownMenu.svelte +0 -0
  90. package/src/lib/components/menus/DropdownMenuItem.svelte +0 -0
  91. package/src/lib/components/textFields/BaseTextField.svelte +0 -130
  92. package/src/lib/components/textFields/OutlinedTextField.svelte +0 -52
  93. package/src/lib/components/textFields/TextField.svelte +0 -36
  94. package/src/lib/components/textFields/TextFieldDefaults.ts +0 -48
  95. package/src/lib/core/helpers/painterResource.ts +0 -26
  96. package/src/lib/core/modifier/ModifierImpl.ts +0 -275
  97. package/src/lib/core/shapes/RoundedCornerShape.ts +0 -53
  98. package/src/lib/core/theme/ColorScheme.ts +0 -25
  99. package/src/lib/core/theme/ComposeTheme.svelte +0 -22
  100. package/src/lib/core/theme/TextStyle.ts +0 -25
  101. package/src/lib/core/theme/cssVars.ts +0 -32
  102. package/src/lib/core/theme/defaults/darkColors.ts +0 -17
  103. package/src/lib/core/theme/defaults/defaultTheme.ts +0 -35
  104. package/src/lib/core/theme/defaults/lightColors.ts +0 -17
  105. package/src/lib/core/theme/defaults/typography.ts +0 -128
  106. package/src/lib/core/theme/getCurrentColor.ts +0 -10
  107. package/src/lib/core/theme/resolve.ts +0 -29
  108. package/src/lib/core/theme/store.ts +0 -26
  109. package/src/lib/core/theme/systemTheme.ts +0 -20
  110. package/src/lib/index.ts +0 -42
  111. package/src/main.ts +0 -9
  112. package/svelte.config.js +0 -8
  113. package/tsconfig.app.json +0 -21
  114. package/tsconfig.json +0 -7
  115. package/tsconfig.node.json +0 -26
  116. package/vite.config.ts +0 -11
  117. /package/{src/lib/components/buttons/ButtonWithIcon.svelte → dist/core/motion/applyAnimation.d.ts} +0 -0
  118. /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
- * Modifier
8
- *
9
- * Modifier is an immutable, chainable object used to decorate or augment
10
- * a UI component.
11
- *
12
- * Inspired by Jetpack Compose Modifier.
13
- *
14
- * Usage:
15
- * ```
16
- * Modifier
17
- * .padding(16)
18
- * .fillMaxWidth()
19
- * .background(ColorScheme.Surface)
20
- * ```
21
- */
22
- export const Modifier = {
23
- /**
24
- * Returns an empty Modifier with no effects.
25
- *
26
- * Useful as a default value or starting point.
27
- */
28
- empty(): ModifierImpl {
29
- return new ModifierImpl();
30
- },
31
-
32
- /**
33
- * Adds padding around the content.
34
- *
35
- * Can be used with:
36
- * - a single number (uniform padding)
37
- * - an object with directional values
38
- *
39
- * Examples:
40
- * ```
41
- * Modifier.padding(16)
42
- * Modifier.padding({ top: 8, bottom: 8 })
43
- * ```
44
- */
45
- padding(
46
- valueOrParams: number | { top?: number; bottom?: number; start?: number; end?: number } = 0,
47
- unit: string = 'px'
48
- ): ModifierImpl {
49
- return new ModifierImpl().padding(valueOrParams,unit);
50
- },
51
-
52
-
53
- /**
54
- * Adds horizontal padding (left and right).
55
- */
56
- paddingHorizontal(value: number): ModifierImpl {
57
- return new ModifierImpl().paddingHorizontal(value);
58
- },
59
-
60
- /**
61
- * Adds a border around the component.
62
- *
63
- * Optionally accepts a Shape to match rounded corners.
64
- *
65
- * Examples:
66
- * ```
67
- * Modifier.border(1, ColorScheme.Outline)
68
- * Modifier.border(2, "#FF0000", RoundedCornerShape(12))
69
- * ```
70
- */
71
- border(width: number, color: string, shape?: Shape): ModifierImpl {
72
- return new ModifierImpl().border(width, color, shape);
73
- },
74
-
75
- /**
76
- * Marks the component as clickable.
77
- *
78
- * This modifier applies interaction semantics such as:
79
- * - pointer cursor
80
- * - user-select disabling
81
- *
82
- * Note:
83
- * The click handler must still be attached at the component level.
84
- *
85
- * Example:
86
- * ```
87
- * <Box
88
- * on:click={onClick}
89
- * modifier={Modifier.clickable(onClick)}
90
- * />
91
- * ```
92
- */
93
- clickable(onClick: () => void): ModifierImpl {
94
- return new ModifierImpl().clickable(onClick);
95
- },
96
-
97
- /**
98
- * Offsets the component visually without affecting its layout.
99
- *
100
- * Equivalent to Jetpack Compose Modifier.offset.
101
- *
102
- * Note:
103
- * This uses CSS transform and does not affect surrounding layout.
104
- */
105
- offset(x: number, y: number): ModifierImpl {
106
- return new ModifierImpl().offset(x, y);
107
- },
108
-
109
- /**
110
- * Enables vertical scrolling for the component.
111
- *
112
- * Useful for Column or large content containers.
113
- */
114
- verticalScroll(enabled: boolean = true): ModifierImpl {
115
- return new ModifierImpl().verticalScroll(enabled);
116
- },
117
-
118
- /**
119
- * Enables horizontal scrolling for the component.
120
- */
121
- horizontalScroll(enabled: boolean = true): ModifierImpl {
122
- return new ModifierImpl().horizontalScroll(enabled);
123
- },
124
-
125
- /**
126
- * Adds vertical padding (top and bottom).
127
- */
128
- paddingVertical(value: number): ModifierImpl {
129
- return new ModifierImpl().paddingVertical(value);
130
- },
131
-
132
- /**
133
- * Aligns the component inside a Box.
134
- *
135
- * ⚠️ This modifier is intended to be used only inside Box layouts.
136
- *
137
- * Example:
138
- * ```
139
- * Modifier.align(Alignment.Center)
140
- * ```
141
- */
142
- align(alignment: BoxAlignment): ModifierImpl {
143
- return new ModifierImpl().align(alignment);
144
- },
145
-
146
- /**
147
- * Makes the component fill the maximum available width.
148
- */
149
- fillMaxWidth(): ModifierImpl {
150
- return new ModifierImpl().fillMaxWidth();
151
- },
152
-
153
- /**
154
- * Makes the component fill the maximum available height.
155
- */
156
- fillMaxHeight(): ModifierImpl {
157
- return new ModifierImpl().fillMaxHeight();
158
- },
159
-
160
- /**
161
- * Makes the component fill both width and height.
162
- */
163
- fillMaxSize(): ModifierImpl {
164
- return new ModifierImpl().fillMaxSize();
165
- },
166
-
167
- /**
168
- * Sets a fixed height for the component.
169
- *
170
- * Accepts either a number (px by default) or a CSS size string.
171
- */
172
- height(value: number | string, unit = 'px'): ModifierImpl {
173
- return new ModifierImpl().height(value, unit);
174
- },
175
-
176
- /**
177
- * Sets a fixed width for the component.
178
- *
179
- * Accepts either a number (px by default) or a CSS size string.
180
- */
181
- width(value: number | string, unit = 'px'): ModifierImpl {
182
- return new ModifierImpl().width(value, unit);
183
- },
184
-
185
- /**
186
- * Applies a background color to the component.
187
- *
188
- * Accepts either:
189
- * - A CSS color string (e.g. "#2A2A2A", "transparent")
190
- * - A Compose color token (e.g. ColorScheme.Surface)
191
- *
192
- * Examples:
193
- * ```
194
- * Modifier.background(ColorScheme.Surface)
195
- * Modifier.background("#121212")
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,6 @@
1
+ export type AnimationSpec = {
2
+ base: string;
3
+ from: string;
4
+ to: string;
5
+ duration: number;
6
+ };
@@ -0,0 +1,5 @@
1
+ export type ContentTransition = {
2
+ enter: string;
3
+ exit: string;
4
+ duration: number;
5
+ };
@@ -0,0 +1,4 @@
1
+ import type { ContentTransition } from "./ContentTransition";
2
+ export declare function slideHorizontal(): ContentTransition;
3
+ export declare function scaleFade(): ContentTransition;
4
+ export declare function fade(duration?: number): ContentTransition;
@@ -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,4 @@
1
+ export type NavBackStackEntry<T = unknown> = {
2
+ route: string;
3
+ args?: T;
4
+ };
@@ -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,6 @@
1
+ export declare function createNavStore(startDestination: string): {
2
+ stack: any;
3
+ navigate<T = unknown>(route: string, args?: T): void;
4
+ pop(): void;
5
+ };
6
+ export type NavStore = ReturnType<typeof createNavStore>;
@@ -0,0 +1,3 @@
1
+ export type Route<T = unknown> = {
2
+ path: string;
3
+ };
@@ -0,0 +1,5 @@
1
+ import type { Route } from "./Route";
2
+ export declare function composable<T>(route: Route<T>, factory: () => any): {
3
+ route: Route<T>;
4
+ component: any;
5
+ };
@@ -0,0 +1,2 @@
1
+ import { NavController } from "./NavController";
2
+ export declare function rememberNavController(startDestination: string): NavController;
@@ -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,5 @@
1
+ export declare const Density: {
2
+ readonly Default: "default";
3
+ readonly Compact: "compact";
4
+ };
5
+ export type DensityToken = typeof Density[keyof typeof Density];
@@ -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
+ };