@x33025/sveltely 0.1.22 → 0.1.24
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/Library/AnimatedNumber/AnimatedNumber.demo.svelte +3 -2
- package/dist/components/Library/ArticleEditor/Blocks/Table.svelte +133 -172
- package/dist/components/Library/Checkbox/Checkbox.demo.svelte +5 -4
- package/dist/components/Library/Checkbox/Checkbox.svelte +6 -5
- package/dist/components/Library/Checkbox/Checkbox.svelte.d.ts +2 -1
- package/dist/components/Library/ChipInput/ChipInput.demo.svelte +3 -2
- package/dist/components/Library/Dropdown/Dropdown.demo.svelte +17 -14
- package/dist/components/Library/Floating/Floating.svelte +5 -6
- package/dist/components/Library/Grid/Grid.svelte +13 -4
- package/dist/components/Library/Grid/Grid.svelte.d.ts +2 -1
- package/dist/components/Library/Grid/GridItem.svelte +12 -3
- package/dist/components/Library/Grid/GridItem.svelte.d.ts +2 -1
- package/dist/components/Library/HStack/HStack.svelte +4 -4
- package/dist/components/Library/HStack/HStack.svelte.d.ts +2 -1
- package/dist/components/Library/Image/Image.demo.svelte +3 -1
- package/dist/components/Library/Image/Image.demo.svelte.d.ts +2 -0
- package/dist/components/Library/ImageMask/ImageMask.demo.svelte +8 -6
- package/dist/components/Library/Label/Label.demo.svelte +4 -4
- package/dist/components/Library/Label/Label.svelte +20 -15
- package/dist/components/Library/NavigationStack/Link.svelte +1 -4
- package/dist/components/Library/Pagination/Pagination.demo.svelte +3 -2
- package/dist/components/Library/Popover/PopoverDebugOverlay.svelte +3 -3
- package/dist/components/Library/Portal/Content.svelte +20 -0
- package/dist/components/Library/Portal/Content.svelte.d.ts +10 -0
- package/dist/components/Library/Portal/Portal.svelte +4 -0
- package/dist/components/Library/Portal/Portal.svelte.d.ts +1 -0
- package/dist/components/Library/Portal/index.d.ts +1 -0
- package/dist/components/Library/Portal/index.js +1 -0
- package/dist/components/Library/ScrollView/ScrollView.svelte +12 -5
- package/dist/components/Library/SearchField/SearchField.demo.svelte +3 -2
- package/dist/components/Library/SearchField/SearchField.svelte +5 -5
- package/dist/components/Library/SearchField/SearchField.svelte.d.ts +2 -1
- package/dist/components/Library/SegmentedPicker/SegmentedPicker.demo.svelte +3 -2
- package/dist/components/Library/Sheet/Sheet.demo.svelte +3 -2
- package/dist/components/Library/Sheet/Sheet.svelte +3 -3
- package/dist/components/Library/Slider/Slider.demo.svelte +3 -2
- package/dist/components/Library/Spinner/Spinner.demo.svelte +3 -2
- package/dist/components/Library/Switch/Switch.demo.svelte +5 -4
- package/dist/components/Library/Switch/Switch.svelte +6 -5
- package/dist/components/Library/Switch/Switch.svelte.d.ts +2 -1
- package/dist/components/Library/Table/Column.svelte +3 -0
- package/dist/components/Library/Table/Column.svelte.d.ts +1 -0
- package/dist/components/Library/Table/Table.demo.svelte +222 -17
- package/dist/components/Library/Table/Table.svelte +98 -57
- package/dist/components/Library/Table/Table.svelte.d.ts +1 -2
- package/dist/components/Library/Table/types.d.ts +1 -0
- package/dist/components/Library/TextShimmer/TextShimmer.demo.svelte +3 -2
- package/dist/components/Library/TimePicker/TimePicker.demo.svelte +3 -10
- package/dist/components/Library/TokenSearchField/TokenSearchField.demo.svelte +3 -2
- package/dist/components/Library/VStack/VStack.svelte +4 -4
- package/dist/components/Library/VStack/VStack.svelte.d.ts +2 -1
- package/dist/components/Local/ColorStyleControls.svelte +0 -8
- package/dist/components/Local/ComponentGrid.svelte +3 -12
- package/dist/components/Local/HeroCard.svelte +1 -2
- package/dist/components/Local/LayoutStyleControls.svelte +33 -25
- package/dist/components/Local/StyleControls.svelte +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/style/index.css +2 -2
- package/dist/style/layout.d.ts +14 -20
- package/dist/style/layout.js +14 -40
- package/dist/style/surface.d.ts +1 -0
- package/dist/style/surface.js +10 -0
- package/dist/style.css +2 -53
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
StyleProps &
|
|
12
12
|
LoaderProps;
|
|
13
13
|
|
|
14
|
-
let { children, ...restProps }: Props = $props();
|
|
14
|
+
let { children, ...restProps }: Props & Record<string, unknown> = $props();
|
|
15
15
|
|
|
16
16
|
const extractedLoaderProps = $derived.by(() => extractLoaderProps(restProps));
|
|
17
17
|
const loaderProps = $derived(extractedLoaderProps.loaderProps);
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
const afterLayoutProps = $derived(extractedLayoutProps.restProps);
|
|
23
23
|
const extractedStyleProps = $derived.by(() => extractStyleProps(afterLayoutProps));
|
|
24
24
|
const styleProps = $derived(extractedStyleProps.styleProps);
|
|
25
|
-
const
|
|
25
|
+
const forwardedProps = $derived(extractedStyleProps.restProps);
|
|
26
26
|
const rootStyle = $derived.by(() =>
|
|
27
27
|
[layoutStyle(layoutProps), surfaceStyle(styleProps, 'vstack')].filter(Boolean).join(' ')
|
|
28
28
|
);
|
|
29
29
|
</script>
|
|
30
30
|
|
|
31
|
-
<div class="vstack" style={rootStyle} {...
|
|
31
|
+
<div class="vstack" style={rootStyle} {...forwardedProps} use:loaderAction={loaderOptions}>
|
|
32
32
|
{#if children}
|
|
33
33
|
{@render children()}
|
|
34
34
|
{/if}
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
--vstack-padding-x: 0px;
|
|
42
42
|
--vstack-padding-y: 0px;
|
|
43
43
|
--vstack-font-size: inherit;
|
|
44
|
-
display: flex;
|
|
44
|
+
display: inline-flex;
|
|
45
45
|
min-width: 0;
|
|
46
46
|
min-height: 0;
|
|
47
47
|
flex-direction: column;
|
|
@@ -5,6 +5,7 @@ import { type StyleProps } from '../../../style/surface';
|
|
|
5
5
|
type Props = {
|
|
6
6
|
children?: Snippet;
|
|
7
7
|
} & LayoutProps & StyleProps & LoaderProps;
|
|
8
|
-
|
|
8
|
+
type $$ComponentProps = Props & Record<string, unknown>;
|
|
9
|
+
declare const VStack: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
9
10
|
type VStack = ReturnType<typeof VStack>;
|
|
10
11
|
export default VStack;
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
orientation="leading"
|
|
35
35
|
width="100%"
|
|
36
36
|
align="center"
|
|
37
|
-
justify="between"
|
|
38
37
|
gap={5}
|
|
39
38
|
>
|
|
40
39
|
<HStack width="100%" align="center" justify="end" gap={5}>
|
|
@@ -52,7 +51,6 @@
|
|
|
52
51
|
orientation="leading"
|
|
53
52
|
width="100%"
|
|
54
53
|
align="center"
|
|
55
|
-
justify="between"
|
|
56
54
|
gap={5}
|
|
57
55
|
>
|
|
58
56
|
<HStack width="100%" align="center" justify="end" gap={5}>
|
|
@@ -70,7 +68,6 @@
|
|
|
70
68
|
orientation="leading"
|
|
71
69
|
width="100%"
|
|
72
70
|
align="center"
|
|
73
|
-
justify="between"
|
|
74
71
|
gap={5}
|
|
75
72
|
>
|
|
76
73
|
<HStack width="100%" align="center" justify="end" gap={5}>
|
|
@@ -90,7 +87,6 @@
|
|
|
90
87
|
orientation="leading"
|
|
91
88
|
width="100%"
|
|
92
89
|
align="center"
|
|
93
|
-
justify="between"
|
|
94
90
|
gap={5}
|
|
95
91
|
>
|
|
96
92
|
<HStack width="100%" align="center" justify="end" gap={5}>
|
|
@@ -108,7 +104,6 @@
|
|
|
108
104
|
orientation="leading"
|
|
109
105
|
width="100%"
|
|
110
106
|
align="center"
|
|
111
|
-
justify="between"
|
|
112
107
|
gap={5}
|
|
113
108
|
>
|
|
114
109
|
<HStack width="100%" align="center" justify="end" gap={5}>
|
|
@@ -123,7 +118,6 @@
|
|
|
123
118
|
orientation="leading"
|
|
124
119
|
width="100%"
|
|
125
120
|
align="center"
|
|
126
|
-
justify="between"
|
|
127
121
|
gap={5}
|
|
128
122
|
>
|
|
129
123
|
<HStack width="100%" align="center" justify="end" gap={5}>
|
|
@@ -141,7 +135,6 @@
|
|
|
141
135
|
orientation="leading"
|
|
142
136
|
width="100%"
|
|
143
137
|
align="center"
|
|
144
|
-
justify="between"
|
|
145
138
|
gap={5}
|
|
146
139
|
>
|
|
147
140
|
<HStack width="100%" align="center" justify="end" gap={5}>
|
|
@@ -159,7 +152,6 @@
|
|
|
159
152
|
orientation="leading"
|
|
160
153
|
width="100%"
|
|
161
154
|
align="center"
|
|
162
|
-
justify="between"
|
|
163
155
|
gap={5}
|
|
164
156
|
>
|
|
165
157
|
<HStack width="100%" align="center" justify="end" gap={5}>
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { Component } from 'svelte';
|
|
3
3
|
import Grid from '../Library/Grid';
|
|
4
4
|
import { GridItem } from '../Library/Grid';
|
|
5
|
+
import ScrollView from '../Library/ScrollView';
|
|
5
6
|
import HeroCard from './HeroCard.svelte';
|
|
6
7
|
|
|
7
8
|
type DemoEntry = {
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
let { demos }: Props = $props();
|
|
20
21
|
</script>
|
|
21
22
|
|
|
22
|
-
<
|
|
23
|
+
<ScrollView width="100%" height="100%">
|
|
23
24
|
<Grid
|
|
24
25
|
columns="repeat(auto-fit, minmax(min(100%, 18rem), 1fr))"
|
|
25
26
|
autoRows={14}
|
|
@@ -36,14 +37,4 @@
|
|
|
36
37
|
</GridItem>
|
|
37
38
|
{/each}
|
|
38
39
|
</Grid>
|
|
39
|
-
</
|
|
40
|
-
|
|
41
|
-
<style>
|
|
42
|
-
.component-grid-scroll {
|
|
43
|
-
width: 100%;
|
|
44
|
-
height: 100%;
|
|
45
|
-
min-width: 0;
|
|
46
|
-
min-height: 0;
|
|
47
|
-
overflow: auto;
|
|
48
|
-
}
|
|
49
|
-
</style>
|
|
40
|
+
</ScrollView>
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
<VStack
|
|
16
16
|
minHeight={14}
|
|
17
17
|
height="100%"
|
|
18
|
-
shrink={0}
|
|
19
18
|
align="stretch"
|
|
20
19
|
gap={5}
|
|
21
20
|
border="1px solid var(--sveltely-border-color)"
|
|
@@ -34,7 +33,7 @@
|
|
|
34
33
|
{/if}
|
|
35
34
|
<div class="hero-card-content">
|
|
36
35
|
{#if children}
|
|
37
|
-
<HStack width="100%" height="100%"
|
|
36
|
+
<HStack width="100%" height="100%" align="center" justify="center">
|
|
38
37
|
{@render children()}
|
|
39
38
|
</HStack>
|
|
40
39
|
{/if}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import HStack from '../Library/HStack';
|
|
2
3
|
import Slider from '../Library/Slider';
|
|
4
|
+
import Spacer from '../Library/Spacer';
|
|
3
5
|
import VStack from '../Library/VStack';
|
|
4
6
|
|
|
5
7
|
type Props = {
|
|
@@ -21,47 +23,53 @@
|
|
|
21
23
|
}: Props = $props();
|
|
22
24
|
</script>
|
|
23
25
|
|
|
24
|
-
<VStack gap={5}>
|
|
25
|
-
<
|
|
26
|
-
<
|
|
26
|
+
<VStack width="100%" gap={5}>
|
|
27
|
+
<VStack width="100%" gap={5}>
|
|
28
|
+
<HStack width="100%" align="center" gap={7.5}>
|
|
27
29
|
<span class="font-medium">Font size</span>
|
|
30
|
+
<Spacer />
|
|
28
31
|
<span class="text-[var(--sveltely-text-secondary-color)]">{fontSize.toFixed(1)}</span>
|
|
29
|
-
</
|
|
32
|
+
</HStack>
|
|
30
33
|
<Slider bind:value={fontSize} min={5} max={20} step={0.5} />
|
|
31
|
-
</
|
|
32
|
-
<
|
|
33
|
-
<
|
|
34
|
+
</VStack>
|
|
35
|
+
<VStack width="100%" gap={5}>
|
|
36
|
+
<HStack width="100%" align="center" gap={7.5}>
|
|
34
37
|
<span class="font-medium">Border radius</span>
|
|
38
|
+
<Spacer />
|
|
35
39
|
<span class="text-[var(--sveltely-text-secondary-color)]">{borderRadius.toFixed(1)}</span>
|
|
36
|
-
</
|
|
40
|
+
</HStack>
|
|
37
41
|
<Slider bind:value={borderRadius} min={0} max={30} step={0.5} />
|
|
38
|
-
</
|
|
39
|
-
<
|
|
40
|
-
<
|
|
42
|
+
</VStack>
|
|
43
|
+
<VStack width="100%" gap={5}>
|
|
44
|
+
<HStack width="100%" align="center" gap={7.5}>
|
|
41
45
|
<span class="font-medium">Padding X</span>
|
|
46
|
+
<Spacer />
|
|
42
47
|
<span class="text-[var(--sveltely-text-secondary-color)]">{paddingX.toFixed(1)}</span>
|
|
43
|
-
</
|
|
48
|
+
</HStack>
|
|
44
49
|
<Slider bind:value={paddingX} min={0} max={20} step="any" />
|
|
45
|
-
</
|
|
46
|
-
<
|
|
47
|
-
<
|
|
50
|
+
</VStack>
|
|
51
|
+
<VStack width="100%" gap={5}>
|
|
52
|
+
<HStack width="100%" align="center" gap={7.5}>
|
|
48
53
|
<span class="font-medium">Padding Y</span>
|
|
54
|
+
<Spacer />
|
|
49
55
|
<span class="text-[var(--sveltely-text-secondary-color)]">{paddingY.toFixed(1)}</span>
|
|
50
|
-
</
|
|
56
|
+
</HStack>
|
|
51
57
|
<Slider bind:value={paddingY} min={0} max={20} step="any" />
|
|
52
|
-
</
|
|
53
|
-
<
|
|
54
|
-
<
|
|
58
|
+
</VStack>
|
|
59
|
+
<VStack width="100%" gap={5}>
|
|
60
|
+
<HStack width="100%" align="center" gap={7.5}>
|
|
55
61
|
<span class="font-medium">Gap</span>
|
|
62
|
+
<Spacer />
|
|
56
63
|
<span class="text-[var(--sveltely-text-secondary-color)]">{gap.toFixed(1)}</span>
|
|
57
|
-
</
|
|
64
|
+
</HStack>
|
|
58
65
|
<Slider bind:value={gap} min={0} max={20} step="any" />
|
|
59
|
-
</
|
|
60
|
-
<
|
|
61
|
-
<
|
|
66
|
+
</VStack>
|
|
67
|
+
<VStack width="100%" gap={5}>
|
|
68
|
+
<HStack width="100%" align="center" gap={7.5}>
|
|
62
69
|
<span class="font-medium">Inset</span>
|
|
70
|
+
<Spacer />
|
|
63
71
|
<span class="text-[var(--sveltely-text-secondary-color)]">{inset.toFixed(1)}</span>
|
|
64
|
-
</
|
|
72
|
+
</HStack>
|
|
65
73
|
<Slider bind:value={inset} min={0} max={10} step="any" />
|
|
66
|
-
</
|
|
74
|
+
</VStack>
|
|
67
75
|
</VStack>
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
let panel = $state<Panel>('layout');
|
|
49
49
|
</script>
|
|
50
50
|
|
|
51
|
-
<VStack gap={7.5} fontSize={8.75} color="var(--sveltely-text-primary-color)">
|
|
51
|
+
<VStack width="100%" gap={7.5} fontSize={8.75} color="var(--sveltely-text-primary-color)">
|
|
52
52
|
<SegmentedPicker options={panelOptions} bind:value={panel} />
|
|
53
53
|
{#if panel === 'layout'}
|
|
54
54
|
<LayoutStyleControls
|
package/dist/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export type { TooltipOptions } from './actions/tooltip';
|
|
|
5
5
|
export { loader } from './actions/loader';
|
|
6
6
|
export type { LoaderOptions } from './actions/loader';
|
|
7
7
|
export type { LoaderProps } from './style/loader';
|
|
8
|
-
export { LayoutAlignment,
|
|
9
|
-
export type { LayoutAlignmentValue, LayoutJustificationValue, LayoutProps,
|
|
8
|
+
export { LayoutAlignment, LayoutDimension, LayoutJustification } from './style/layout';
|
|
9
|
+
export type { FrameProps, LayoutAlignmentValue, LayoutDimensionValue, LayoutJustificationValue, LayoutProps, StackProps } from './style/layout';
|
|
10
10
|
export { LabelOrientation } from './style/label';
|
|
11
11
|
export type { LabelOrientationValue } from './style/label';
|
|
12
12
|
export { ImageFit, ImageLoading } from './style/media';
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ export { motion, hover } from './actions/motion';
|
|
|
2
2
|
export { portalHost, portalContent } from './actions/portal';
|
|
3
3
|
export { tooltip } from './actions/tooltip';
|
|
4
4
|
export { loader } from './actions/loader';
|
|
5
|
-
export { LayoutAlignment,
|
|
5
|
+
export { LayoutAlignment, LayoutDimension, LayoutJustification } from './style/layout';
|
|
6
6
|
export { LabelOrientation } from './style/label';
|
|
7
7
|
export { ImageFit, ImageLoading } from './style/media';
|
|
8
8
|
export { ScrollAxis } from './style/scroll';
|
package/dist/style/index.css
CHANGED
package/dist/style/layout.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
type StringWithAutocomplete<T extends string> = T | (string & {});
|
|
2
|
-
export declare const
|
|
3
|
-
readonly
|
|
4
|
-
readonly fit: "fit";
|
|
2
|
+
export declare const LayoutDimension: {
|
|
3
|
+
readonly infinity: "infinity";
|
|
5
4
|
};
|
|
6
5
|
export declare const LayoutAlignment: {
|
|
7
6
|
readonly start: "start";
|
|
@@ -14,31 +13,26 @@ export declare const LayoutJustification: {
|
|
|
14
13
|
readonly start: "start";
|
|
15
14
|
readonly center: "center";
|
|
16
15
|
readonly end: "end";
|
|
17
|
-
readonly between: "between";
|
|
18
|
-
readonly around: "around";
|
|
19
|
-
readonly evenly: "evenly";
|
|
20
16
|
};
|
|
21
|
-
export type
|
|
17
|
+
export type LayoutDimensionValue = (typeof LayoutDimension)[keyof typeof LayoutDimension];
|
|
22
18
|
export type LayoutAlignmentValue = (typeof LayoutAlignment)[keyof typeof LayoutAlignment];
|
|
23
19
|
export type LayoutJustificationValue = (typeof LayoutJustification)[keyof typeof LayoutJustification];
|
|
24
|
-
export type
|
|
20
|
+
export type LayoutDimension = StringWithAutocomplete<LayoutDimensionValue> | number;
|
|
25
21
|
export type LayoutAlignment = LayoutAlignmentValue;
|
|
26
22
|
export type LayoutJustification = LayoutJustificationValue;
|
|
27
|
-
export type
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
shrink?: boolean | number;
|
|
37
|
-
basis?: number | string;
|
|
38
|
-
border?: boolean | string;
|
|
23
|
+
export type FrameProps = {
|
|
24
|
+
width?: LayoutDimension;
|
|
25
|
+
height?: LayoutDimension;
|
|
26
|
+
minWidth?: LayoutDimension;
|
|
27
|
+
minHeight?: LayoutDimension;
|
|
28
|
+
maxWidth?: LayoutDimension;
|
|
29
|
+
maxHeight?: LayoutDimension;
|
|
30
|
+
};
|
|
31
|
+
export type StackProps = {
|
|
39
32
|
align?: LayoutAlignment;
|
|
40
33
|
justify?: LayoutJustification;
|
|
41
34
|
};
|
|
35
|
+
export type LayoutProps = FrameProps & StackProps;
|
|
42
36
|
export declare const extractLayoutProps: <T extends Record<string, unknown>>(props: T) => {
|
|
43
37
|
layoutProps: Partial<LayoutProps>;
|
|
44
38
|
restProps: Record<string, unknown>;
|
package/dist/style/layout.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export const
|
|
2
|
-
|
|
3
|
-
fit: 'fit'
|
|
1
|
+
export const LayoutDimension = {
|
|
2
|
+
infinity: 'infinity'
|
|
4
3
|
};
|
|
5
4
|
export const LayoutAlignment = {
|
|
6
5
|
start: 'start',
|
|
@@ -12,45 +11,33 @@ export const LayoutAlignment = {
|
|
|
12
11
|
export const LayoutJustification = {
|
|
13
12
|
start: 'start',
|
|
14
13
|
center: 'center',
|
|
15
|
-
end: 'end'
|
|
16
|
-
between: 'between',
|
|
17
|
-
around: 'around',
|
|
18
|
-
evenly: 'evenly'
|
|
14
|
+
end: 'end'
|
|
19
15
|
};
|
|
20
16
|
const LAYOUT_PROP_KEYS = new Set([
|
|
21
|
-
'size',
|
|
22
17
|
'width',
|
|
23
18
|
'height',
|
|
24
19
|
'minWidth',
|
|
25
20
|
'minHeight',
|
|
26
21
|
'maxWidth',
|
|
27
22
|
'maxHeight',
|
|
28
|
-
'grow',
|
|
29
|
-
'shrink',
|
|
30
|
-
'basis',
|
|
31
|
-
'border',
|
|
32
23
|
'align',
|
|
33
24
|
'justify'
|
|
34
25
|
]);
|
|
35
26
|
const toRem = (value) => value === undefined ? undefined : typeof value === 'number' ? `${value}rem` : value;
|
|
36
|
-
const
|
|
37
|
-
if (value === '
|
|
27
|
+
const toDimension = (value) => {
|
|
28
|
+
if (value === 'infinity')
|
|
38
29
|
return '100%';
|
|
39
|
-
if (value === 'fit')
|
|
40
|
-
return 'fit-content';
|
|
41
30
|
return toRem(value);
|
|
42
31
|
};
|
|
32
|
+
const blockedIntrinsicSizes = new Set(['full', 'fit', 'min-content', 'max-content', 'fit-content']);
|
|
43
33
|
const pushDeclaration = (declarations, name, value) => {
|
|
44
|
-
|
|
34
|
+
if (typeof value === 'string' && blockedIntrinsicSizes.has(value))
|
|
35
|
+
return;
|
|
36
|
+
const resolved = toDimension(value);
|
|
45
37
|
if (resolved === undefined)
|
|
46
38
|
return;
|
|
47
39
|
declarations.push(`${name}: ${resolved};`);
|
|
48
40
|
};
|
|
49
|
-
const pushFlexValue = (declarations, name, value) => {
|
|
50
|
-
if (value === undefined)
|
|
51
|
-
return;
|
|
52
|
-
declarations.push(`${name}: ${value === true ? 1 : value === false ? 0 : value};`);
|
|
53
|
-
};
|
|
54
41
|
const alignValues = {
|
|
55
42
|
start: 'flex-start',
|
|
56
43
|
center: 'center',
|
|
@@ -61,10 +48,7 @@ const alignValues = {
|
|
|
61
48
|
const justifyValues = {
|
|
62
49
|
start: 'flex-start',
|
|
63
50
|
center: 'center',
|
|
64
|
-
end: 'flex-end'
|
|
65
|
-
between: 'space-between',
|
|
66
|
-
around: 'space-around',
|
|
67
|
-
evenly: 'space-evenly'
|
|
51
|
+
end: 'flex-end'
|
|
68
52
|
};
|
|
69
53
|
export const extractLayoutProps = (props) => {
|
|
70
54
|
const layoutProps = {};
|
|
@@ -85,27 +69,17 @@ export const layoutStyle = (styles) => {
|
|
|
85
69
|
if (!styles)
|
|
86
70
|
return '';
|
|
87
71
|
const declarations = [];
|
|
88
|
-
const resolvedSize = toSize(styles.size);
|
|
89
|
-
if (resolvedSize !== undefined) {
|
|
90
|
-
declarations.push(`width: ${resolvedSize};`, `height: ${resolvedSize};`);
|
|
91
|
-
}
|
|
92
72
|
pushDeclaration(declarations, 'width', styles.width);
|
|
93
73
|
pushDeclaration(declarations, 'height', styles.height);
|
|
94
74
|
pushDeclaration(declarations, 'min-width', styles.minWidth);
|
|
95
75
|
pushDeclaration(declarations, 'min-height', styles.minHeight);
|
|
96
76
|
pushDeclaration(declarations, 'max-width', styles.maxWidth);
|
|
97
77
|
pushDeclaration(declarations, 'max-height', styles.maxHeight);
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
pushDeclaration(declarations, 'flex-basis', styles.basis);
|
|
101
|
-
if (styles.border === true) {
|
|
102
|
-
declarations.push('border: 1px solid var(--sveltely-border-color);');
|
|
78
|
+
if (styles.maxWidth === 'infinity' && styles.width === undefined) {
|
|
79
|
+
declarations.push('width: 100%;');
|
|
103
80
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
? styles.border
|
|
107
|
-
: `1px solid ${styles.border}`;
|
|
108
|
-
declarations.push(`border: ${borderValue};`);
|
|
81
|
+
if (styles.maxHeight === 'infinity' && styles.height === undefined) {
|
|
82
|
+
declarations.push('height: 100%;');
|
|
109
83
|
}
|
|
110
84
|
if (styles.align !== undefined) {
|
|
111
85
|
declarations.push(`align-items: ${alignValues[styles.align]};`);
|
package/dist/style/surface.d.ts
CHANGED
package/dist/style/surface.js
CHANGED
|
@@ -5,6 +5,7 @@ const STYLE_PROP_KEYS = new Set([
|
|
|
5
5
|
'gap',
|
|
6
6
|
'borderRadius',
|
|
7
7
|
'inset',
|
|
8
|
+
'border',
|
|
8
9
|
'background',
|
|
9
10
|
'borderColor',
|
|
10
11
|
'color'
|
|
@@ -45,6 +46,15 @@ export const surfaceStyle = (styles, prefix = 'surface') => {
|
|
|
45
46
|
pushVar(declarations, `--${prefix}-gap`, styles.gap);
|
|
46
47
|
pushVar(declarations, `--${prefix}-border-radius`, styles.borderRadius);
|
|
47
48
|
pushVar(declarations, `--${prefix}-inset`, styles.inset);
|
|
49
|
+
if (styles.border === true) {
|
|
50
|
+
declarations.push('border: 1px solid var(--sveltely-border-color);');
|
|
51
|
+
}
|
|
52
|
+
else if (typeof styles.border === 'string') {
|
|
53
|
+
const borderValue = /\b(solid|dashed|dotted|double|none|hidden)\b|\d/.test(styles.border)
|
|
54
|
+
? styles.border
|
|
55
|
+
: `1px solid ${styles.border}`;
|
|
56
|
+
declarations.push(`border: ${borderValue};`);
|
|
57
|
+
}
|
|
48
58
|
if (styles.background !== undefined) {
|
|
49
59
|
declarations.push(`background: ${styles.background};`);
|
|
50
60
|
}
|
package/dist/style.css
CHANGED
|
@@ -24,8 +24,6 @@
|
|
|
24
24
|
--color-black: #000;
|
|
25
25
|
--color-white: #fff;
|
|
26
26
|
--spacing: 0.25rem;
|
|
27
|
-
--container-sm: 24rem;
|
|
28
|
-
--container-md: 28rem;
|
|
29
27
|
--container-3xl: 48rem;
|
|
30
28
|
--text-xs: 0.75rem;
|
|
31
29
|
--text-xs--line-height: calc(1 / 0.75);
|
|
@@ -289,9 +287,6 @@
|
|
|
289
287
|
.h-5 {
|
|
290
288
|
height: calc(var(--spacing) * 5);
|
|
291
289
|
}
|
|
292
|
-
.h-36 {
|
|
293
|
-
height: calc(var(--spacing) * 36);
|
|
294
|
-
}
|
|
295
290
|
.h-full {
|
|
296
291
|
height: 100%;
|
|
297
292
|
}
|
|
@@ -313,33 +308,15 @@
|
|
|
313
308
|
.max-w-3xl {
|
|
314
309
|
max-width: var(--container-3xl);
|
|
315
310
|
}
|
|
316
|
-
.max-w-md {
|
|
317
|
-
max-width: var(--container-md);
|
|
318
|
-
}
|
|
319
|
-
.max-w-sm {
|
|
320
|
-
max-width: var(--container-sm);
|
|
321
|
-
}
|
|
322
|
-
.min-w-0 {
|
|
323
|
-
min-width: calc(var(--spacing) * 0);
|
|
324
|
-
}
|
|
325
311
|
.flex-1 {
|
|
326
312
|
flex: 1;
|
|
327
313
|
}
|
|
328
314
|
.flex-shrink {
|
|
329
315
|
flex-shrink: 1;
|
|
330
316
|
}
|
|
331
|
-
.shrink {
|
|
332
|
-
flex-shrink: 1;
|
|
333
|
-
}
|
|
334
317
|
.shrink-0 {
|
|
335
318
|
flex-shrink: 0;
|
|
336
319
|
}
|
|
337
|
-
.flex-grow {
|
|
338
|
-
flex-grow: 1;
|
|
339
|
-
}
|
|
340
|
-
.grow {
|
|
341
|
-
flex-grow: 1;
|
|
342
|
-
}
|
|
343
320
|
.border-collapse {
|
|
344
321
|
border-collapse: collapse;
|
|
345
322
|
}
|
|
@@ -379,30 +356,15 @@
|
|
|
379
356
|
.items-center {
|
|
380
357
|
align-items: center;
|
|
381
358
|
}
|
|
382
|
-
.items-start {
|
|
383
|
-
align-items: flex-start;
|
|
384
|
-
}
|
|
385
359
|
.justify-between {
|
|
386
360
|
justify-content: space-between;
|
|
387
361
|
}
|
|
388
362
|
.justify-center {
|
|
389
363
|
justify-content: center;
|
|
390
364
|
}
|
|
391
|
-
.gap-0\.5 {
|
|
392
|
-
gap: calc(var(--spacing) * 0.5);
|
|
393
|
-
}
|
|
394
|
-
.gap-1 {
|
|
395
|
-
gap: calc(var(--spacing) * 1);
|
|
396
|
-
}
|
|
397
365
|
.gap-2 {
|
|
398
366
|
gap: calc(var(--spacing) * 2);
|
|
399
367
|
}
|
|
400
|
-
.gap-3 {
|
|
401
|
-
gap: calc(var(--spacing) * 3);
|
|
402
|
-
}
|
|
403
|
-
.gap-4 {
|
|
404
|
-
gap: calc(var(--spacing) * 4);
|
|
405
|
-
}
|
|
406
368
|
.space-y-1 {
|
|
407
369
|
:where(& > :not(:last-child)) {
|
|
408
370
|
--tw-space-y-reverse: 0;
|
|
@@ -473,9 +435,6 @@
|
|
|
473
435
|
.bg-transparent {
|
|
474
436
|
background-color: transparent;
|
|
475
437
|
}
|
|
476
|
-
.bg-white {
|
|
477
|
-
background-color: var(--color-white);
|
|
478
|
-
}
|
|
479
438
|
.bg-zinc-100 {
|
|
480
439
|
background-color: var(--color-zinc-100);
|
|
481
440
|
}
|
|
@@ -771,16 +730,6 @@
|
|
|
771
730
|
opacity: 50%;
|
|
772
731
|
}
|
|
773
732
|
}
|
|
774
|
-
.md\:grid-cols-2 {
|
|
775
|
-
@media (width >= 48rem) {
|
|
776
|
-
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
.md\:grid-cols-\[minmax\(0\,18rem\)_minmax\(8rem\,1fr\)\] {
|
|
780
|
-
@media (width >= 48rem) {
|
|
781
|
-
grid-template-columns: minmax(0,18rem) minmax(8rem,1fr);
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
733
|
}
|
|
785
734
|
@layer base {
|
|
786
735
|
:root {
|
|
@@ -850,13 +799,13 @@
|
|
|
850
799
|
justify-content: center;
|
|
851
800
|
}
|
|
852
801
|
.vstack {
|
|
853
|
-
display: flex;
|
|
802
|
+
display: inline-flex;
|
|
854
803
|
min-height: calc(var(--spacing) * 0);
|
|
855
804
|
min-width: calc(var(--spacing) * 0);
|
|
856
805
|
flex-direction: column;
|
|
857
806
|
}
|
|
858
807
|
.hstack {
|
|
859
|
-
display: flex;
|
|
808
|
+
display: inline-flex;
|
|
860
809
|
min-height: calc(var(--spacing) * 0);
|
|
861
810
|
min-width: calc(var(--spacing) * 0);
|
|
862
811
|
flex-direction: row;
|