@x33025/sveltely 0.1.23 → 0.1.25

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 (107) hide show
  1. package/dist/actions/LoaderOverlay.svelte +10 -3
  2. package/dist/components/Library/Accordion/Accordion.demo.svelte +21 -0
  3. package/dist/components/Library/Accordion/Accordion.demo.svelte.d.ts +9 -0
  4. package/dist/components/Library/Accordion/Accordion.svelte +78 -0
  5. package/dist/components/Library/Accordion/Accordion.svelte.d.ts +14 -0
  6. package/dist/components/Library/Accordion/Content.svelte +57 -0
  7. package/dist/components/Library/Accordion/Content.svelte.d.ts +8 -0
  8. package/dist/components/Library/Accordion/Header.svelte +98 -0
  9. package/dist/components/Library/Accordion/Header.svelte.d.ts +10 -0
  10. package/dist/components/Library/Accordion/context.d.ts +9 -0
  11. package/dist/components/Library/Accordion/context.js +6 -0
  12. package/dist/components/Library/Accordion/index.d.ts +9 -0
  13. package/dist/components/Library/Accordion/index.js +7 -0
  14. package/dist/components/Library/AnimatedNumber/AnimatedNumber.demo.svelte +3 -2
  15. package/dist/components/Library/ArticleEditor/ArticleEditor.svelte +1 -2
  16. package/dist/components/Library/ArticleEditor/Blocks/Table.svelte +133 -172
  17. package/dist/components/Library/Checkbox/Checkbox.demo.svelte +5 -4
  18. package/dist/components/Library/Checkbox/Checkbox.svelte +6 -5
  19. package/dist/components/Library/Checkbox/Checkbox.svelte.d.ts +2 -1
  20. package/dist/components/Library/ChipInput/ChipInput.demo.svelte +3 -2
  21. package/dist/components/Library/Dropdown/Dropdown.demo.svelte +20 -15
  22. package/dist/components/Library/Floating/Floating.svelte +5 -6
  23. package/dist/components/Library/Grid/Grid.demo.svelte +58 -0
  24. package/dist/components/Library/Grid/Grid.demo.svelte.d.ts +25 -0
  25. package/dist/components/Library/Grid/Grid.svelte +128 -25
  26. package/dist/components/Library/Grid/Grid.svelte.d.ts +38 -9
  27. package/dist/components/Library/Grid/GridItem.svelte +18 -14
  28. package/dist/components/Library/Grid/GridItem.svelte.d.ts +2 -1
  29. package/dist/components/Library/HStack/HStack.svelte +4 -4
  30. package/dist/components/Library/HStack/HStack.svelte.d.ts +2 -1
  31. package/dist/components/Library/Image/Image.demo.svelte +3 -1
  32. package/dist/components/Library/Image/Image.demo.svelte.d.ts +2 -0
  33. package/dist/components/Library/ImageMask/ImageMask.demo.svelte +8 -6
  34. package/dist/components/Library/Label/Label.demo.svelte +5 -5
  35. package/dist/components/Library/Label/Label.svelte +10 -26
  36. package/dist/components/Library/NavigationStack/Link.svelte +1 -4
  37. package/dist/components/Library/Notifications/Notifications.demo.svelte +63 -0
  38. package/dist/components/Library/Notifications/Notifications.demo.svelte.d.ts +9 -0
  39. package/dist/components/Library/Notifications/Notifications.svelte +155 -0
  40. package/dist/components/Library/Notifications/Notifications.svelte.d.ts +35 -0
  41. package/dist/components/Library/Notifications/index.d.ts +2 -0
  42. package/dist/components/Library/Notifications/index.js +1 -0
  43. package/dist/components/Library/Notifications/types.d.ts +8 -0
  44. package/dist/components/Library/Notifications/types.js +1 -0
  45. package/dist/components/Library/NumberField/NumberField.svelte +25 -19
  46. package/dist/components/Library/Pagination/Pagination.demo.svelte +3 -2
  47. package/dist/components/Library/Pagination/Pagination.svelte +6 -18
  48. package/dist/components/Library/Popover/PopoverDebugOverlay.svelte +3 -3
  49. package/dist/components/Library/Portal/Content.svelte +20 -0
  50. package/dist/components/Library/Portal/Content.svelte.d.ts +10 -0
  51. package/dist/components/Library/Portal/Portal.svelte +4 -0
  52. package/dist/components/Library/Portal/Portal.svelte.d.ts +1 -0
  53. package/dist/components/Library/Portal/index.d.ts +1 -0
  54. package/dist/components/Library/Portal/index.js +1 -0
  55. package/dist/components/Library/ScrollView/ScrollView.svelte +88 -9
  56. package/dist/components/Library/ScrollView/ScrollView.svelte.d.ts +9 -2
  57. package/dist/components/Library/ScrollView/index.d.ts +1 -1
  58. package/dist/components/Library/SearchField/SearchField.demo.svelte +3 -2
  59. package/dist/components/Library/SearchField/SearchField.svelte +5 -5
  60. package/dist/components/Library/SearchField/SearchField.svelte.d.ts +2 -1
  61. package/dist/components/Library/SegmentedPicker/SegmentedPicker.demo.svelte +3 -2
  62. package/dist/components/Library/Sheet/Sheet.demo.svelte +3 -2
  63. package/dist/components/Library/Sheet/Sheet.svelte +3 -3
  64. package/dist/components/Library/Slider/Slider.demo.svelte +3 -2
  65. package/dist/components/Library/Spinner/Spinner.demo.svelte +3 -2
  66. package/dist/components/Library/Switch/Switch.demo.svelte +5 -4
  67. package/dist/components/Library/Switch/Switch.svelte +6 -5
  68. package/dist/components/Library/Switch/Switch.svelte.d.ts +2 -1
  69. package/dist/components/Library/Table/Column.svelte +3 -0
  70. package/dist/components/Library/Table/Column.svelte.d.ts +1 -0
  71. package/dist/components/Library/Table/Table.demo.svelte +230 -17
  72. package/dist/components/Library/Table/Table.svelte +322 -78
  73. package/dist/components/Library/Table/Table.svelte.d.ts +5 -0
  74. package/dist/components/Library/Table/types.d.ts +1 -0
  75. package/dist/components/Library/TextField/TextField.svelte +20 -14
  76. package/dist/components/Library/TextShimmer/TextShimmer.demo.svelte +3 -2
  77. package/dist/components/Library/TimePicker/TimePicker.demo.svelte +3 -10
  78. package/dist/components/Library/TokenSearchField/TokenSearchField.demo.svelte +3 -2
  79. package/dist/components/Library/VStack/VStack.svelte +4 -4
  80. package/dist/components/Library/VStack/VStack.svelte.d.ts +2 -1
  81. package/dist/components/Local/ColorStyleControls.svelte +25 -72
  82. package/dist/components/Local/ComponentGrid.svelte +99 -27
  83. package/dist/components/Local/ComponentGrid.svelte.d.ts +2 -1
  84. package/dist/components/Local/ComponentPage.svelte +74 -0
  85. package/dist/components/Local/ComponentPage.svelte.d.ts +13 -0
  86. package/dist/components/Local/HeroCard.svelte +10 -6
  87. package/dist/components/Local/LayoutStyleControls.svelte +33 -25
  88. package/dist/components/Local/StyleControls.svelte +1 -1
  89. package/dist/index.d.ts +8 -3
  90. package/dist/index.js +4 -1
  91. package/dist/style/index.css +3 -4
  92. package/dist/style/layout.d.ts +15 -36
  93. package/dist/style/layout.js +35 -83
  94. package/dist/style/surface.d.ts +1 -0
  95. package/dist/style/surface.js +10 -0
  96. package/dist/style.css +3 -51
  97. package/dist/viewport/geometry.d.ts +8 -0
  98. package/dist/viewport/geometry.js +43 -0
  99. package/dist/viewport/index.d.ts +4 -0
  100. package/dist/viewport/index.js +4 -0
  101. package/dist/viewport/layout.d.ts +4 -0
  102. package/dist/viewport/layout.js +138 -0
  103. package/dist/viewport/placement.d.ts +4 -0
  104. package/dist/viewport/placement.js +14 -0
  105. package/dist/viewport/types.d.ts +81 -0
  106. package/dist/viewport/types.js +1 -0
  107. 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 props = $derived(extractedStyleProps.restProps);
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} {...props} use:loaderAction={loaderOptions}>
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
- declare const VStack: import("svelte").Component<Props, {}, "">;
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;
@@ -2,6 +2,7 @@
2
2
  import Divider from '../Library/Divider';
3
3
  import HStack from '../Library/HStack';
4
4
  import Label from '../Library/Label';
5
+ import Spacer from '../Library/Spacer';
5
6
  import VStack from '../Library/VStack';
6
7
 
7
8
  type Props = {
@@ -29,15 +30,9 @@
29
30
 
30
31
  <VStack gap={5}>
31
32
  <Label label="Text colors" color="var(--sveltely-text-tertiary-color)" fontSize={7.5} />
32
- <Label
33
- label="Text primary"
34
- orientation="leading"
35
- width="100%"
36
- align="center"
37
- justify="between"
38
- gap={5}
39
- >
40
- <HStack width="100%" align="center" justify="end" gap={5}>
33
+ <Label label="Text primary" orientation="leading" width="100%" gap={5}>
34
+ <HStack width="100%" gap={5}>
35
+ <Spacer />
41
36
  <span class="text-[var(--sveltely-text-secondary-color)]">{textPrimaryColor}</span>
42
37
  <input
43
38
  bind:value={textPrimaryColor}
@@ -47,15 +42,9 @@
47
42
  />
48
43
  </HStack>
49
44
  </Label>
50
- <Label
51
- label="Text secondary"
52
- orientation="leading"
53
- width="100%"
54
- align="center"
55
- justify="between"
56
- gap={5}
57
- >
58
- <HStack width="100%" align="center" justify="end" gap={5}>
45
+ <Label label="Text secondary" orientation="leading" width="100%" gap={5}>
46
+ <HStack width="100%" gap={5}>
47
+ <Spacer />
59
48
  <span class="text-[var(--sveltely-text-secondary-color)]">{textSecondaryColor}</span>
60
49
  <input
61
50
  bind:value={textSecondaryColor}
@@ -65,15 +54,9 @@
65
54
  />
66
55
  </HStack>
67
56
  </Label>
68
- <Label
69
- label="Text tertiary"
70
- orientation="leading"
71
- width="100%"
72
- align="center"
73
- justify="between"
74
- gap={5}
75
- >
76
- <HStack width="100%" align="center" justify="end" gap={5}>
57
+ <Label label="Text tertiary" orientation="leading" width="100%" gap={5}>
58
+ <HStack width="100%" gap={5}>
59
+ <Spacer />
77
60
  <span class="text-[var(--sveltely-text-secondary-color)]">{textTertiaryColor}</span>
78
61
  <input
79
62
  bind:value={textTertiaryColor}
@@ -85,15 +68,9 @@
85
68
  </Label>
86
69
  <Divider />
87
70
  <Label label="Surface colors" color="var(--sveltely-text-tertiary-color)" fontSize={7.5} />
88
- <Label
89
- label="Background color"
90
- orientation="leading"
91
- width="100%"
92
- align="center"
93
- justify="between"
94
- gap={5}
95
- >
96
- <HStack width="100%" align="center" justify="end" gap={5}>
71
+ <Label label="Background color" orientation="leading" width="100%" gap={5}>
72
+ <HStack width="100%" gap={5}>
73
+ <Spacer />
97
74
  <span class="text-[var(--sveltely-text-secondary-color)]">{backgroundColor}</span>
98
75
  <input
99
76
  bind:value={backgroundColor}
@@ -103,30 +80,18 @@
103
80
  />
104
81
  </HStack>
105
82
  </Label>
106
- <Label
107
- label="Border color"
108
- orientation="leading"
109
- width="100%"
110
- align="center"
111
- justify="between"
112
- gap={5}
113
- >
114
- <HStack width="100%" align="center" justify="end" gap={5}>
83
+ <Label label="Border color" orientation="leading" width="100%" gap={5}>
84
+ <HStack width="100%" gap={5}>
85
+ <Spacer />
115
86
  <span class="text-[var(--sveltely-text-secondary-color)]">{borderColor}</span>
116
87
  <input bind:value={borderColor} type="color" aria-label="Border color" class="color-input" />
117
88
  </HStack>
118
89
  </Label>
119
90
  <Divider />
120
91
  <Label label="Control colors" color="var(--sveltely-text-tertiary-color)" fontSize={7.5} />
121
- <Label
122
- label="Control active"
123
- orientation="leading"
124
- width="100%"
125
- align="center"
126
- justify="between"
127
- gap={5}
128
- >
129
- <HStack width="100%" align="center" justify="end" gap={5}>
92
+ <Label label="Control active" orientation="leading" width="100%" gap={5}>
93
+ <HStack width="100%" gap={5}>
94
+ <Spacer />
130
95
  <span class="text-[var(--sveltely-text-secondary-color)]">{controlActiveColor}</span>
131
96
  <input
132
97
  bind:value={controlActiveColor}
@@ -136,15 +101,9 @@
136
101
  />
137
102
  </HStack>
138
103
  </Label>
139
- <Label
140
- label="Control background"
141
- orientation="leading"
142
- width="100%"
143
- align="center"
144
- justify="between"
145
- gap={5}
146
- >
147
- <HStack width="100%" align="center" justify="end" gap={5}>
104
+ <Label label="Control background" orientation="leading" width="100%" gap={5}>
105
+ <HStack width="100%" gap={5}>
106
+ <Spacer />
148
107
  <span class="text-[var(--sveltely-text-secondary-color)]">{controlBackgroundColor}</span>
149
108
  <input
150
109
  bind:value={controlBackgroundColor}
@@ -154,15 +113,9 @@
154
113
  />
155
114
  </HStack>
156
115
  </Label>
157
- <Label
158
- label="Control inactive"
159
- orientation="leading"
160
- width="100%"
161
- align="center"
162
- justify="between"
163
- gap={5}
164
- >
165
- <HStack width="100%" align="center" justify="end" gap={5}>
116
+ <Label label="Control inactive" orientation="leading" width="100%" gap={5}>
117
+ <HStack width="100%" gap={5}>
118
+ <Spacer />
166
119
  <span class="text-[var(--sveltely-text-secondary-color)]">{controlInactiveColor}</span>
167
120
  <input
168
121
  bind:value={controlInactiveColor}
@@ -1,10 +1,13 @@
1
1
  <script lang="ts">
2
+ import { tick } from 'svelte';
2
3
  import type { Component } from 'svelte';
3
- import Grid from '../Library/Grid';
4
- import { GridItem } from '../Library/Grid';
5
- import HeroCard from './HeroCard.svelte';
4
+ import ScrollView, {
5
+ type ScrollGeometry,
6
+ type ScrollViewHandle
7
+ } from '../Library/ScrollView';
8
+ import ComponentPage, { type ComponentPageEntry } from './ComponentPage.svelte';
6
9
 
7
- type DemoEntry = {
10
+ type DemoEntry = ComponentPageEntry & {
8
11
  component: Component;
9
12
  name: string;
10
13
  description: string;
@@ -17,33 +20,102 @@
17
20
  };
18
21
 
19
22
  let { demos }: Props = $props();
23
+
24
+ let viewport = $state<ScrollViewHandle | null>(null);
25
+ let page = $state(1);
26
+ let pageHeight = $state(0);
27
+ let snapTimeout: ReturnType<typeof setTimeout> | null = null;
28
+ let snapReleaseTimeout: ReturnType<typeof setTimeout> | null = null;
29
+ let snapping = $state(false);
30
+
31
+ const totalPages = $derived(Math.max(1, demos.length));
32
+ const safePage = $derived(Math.min(Math.max(page, 1), totalPages));
33
+ const pagePeek = $derived(pageHeight <= 0 ? 0 : Math.min(72, Math.max(32, pageHeight * 0.08)));
34
+ const pageStep = $derived(Math.max(1, pageHeight - pagePeek * 2));
35
+
36
+ const clampPage = (nextPage: number) => Math.min(Math.max(nextPage, 1), totalPages);
37
+
38
+ const scrollToPage = async (nextPage: number) => {
39
+ const clamped = clampPage(nextPage);
40
+ if (snapTimeout) {
41
+ clearTimeout(snapTimeout);
42
+ snapTimeout = null;
43
+ }
44
+ page = clamped;
45
+ await tick();
46
+ const height = viewport?.clientHeight || pageHeight;
47
+ if (!viewport || height <= 0) return;
48
+ snapping = true;
49
+ viewport.scrollTo({ top: (clamped - 1) * pageStep, left: 0, behavior: 'smooth' });
50
+ if (snapReleaseTimeout) clearTimeout(snapReleaseTimeout);
51
+ snapReleaseTimeout = setTimeout(() => {
52
+ snapping = false;
53
+ snapReleaseTimeout = null;
54
+ }, 320);
55
+ };
56
+
57
+ const schedulePageSnap = (nextPage: number) => {
58
+ if (snapTimeout) clearTimeout(snapTimeout);
59
+ snapTimeout = setTimeout(() => {
60
+ snapTimeout = null;
61
+ void scrollToPage(nextPage);
62
+ }, 120);
63
+ };
64
+
65
+ const handleScroll = (geometry: ScrollGeometry) => {
66
+ pageHeight = geometry.viewport.height;
67
+ if (geometry.viewport.height <= 0) return;
68
+ const nextPage = clampPage(Math.round(geometry.offset.y / pageStep) + 1);
69
+ if (nextPage !== page) page = nextPage;
70
+ if (snapping) return;
71
+ const targetOffset = (nextPage - 1) * pageStep;
72
+ if (Math.abs(geometry.offset.y - targetOffset) > 1) {
73
+ schedulePageSnap(nextPage);
74
+ }
75
+ };
76
+
77
+ $effect(() => {
78
+ if (page === safePage) return;
79
+ page = safePage;
80
+ });
81
+
82
+ $effect(() => {
83
+ return () => {
84
+ if (snapTimeout) clearTimeout(snapTimeout);
85
+ if (snapReleaseTimeout) clearTimeout(snapReleaseTimeout);
86
+ };
87
+ });
20
88
  </script>
21
89
 
22
- <div class="component-grid-scroll">
23
- <Grid
24
- columns="repeat(auto-fit, minmax(min(100%, 18rem), 1fr))"
25
- autoRows={14}
26
- gap={10}
27
- paddingX={15}
28
- paddingY={15}
29
- >
30
- {#each demos as entry (entry.name)}
31
- {@const DemoComponent = entry.component}
32
- <GridItem columnSpan={entry.columnSpan ?? 1} rowSpan={entry.rowSpan ?? 1}>
33
- <HeroCard title={entry.name} description={entry.description}>
34
- <DemoComponent />
35
- </HeroCard>
36
- </GridItem>
37
- {/each}
38
- </Grid>
39
- </div>
90
+ <ScrollView
91
+ bind:viewport
92
+ width="100%"
93
+ height="100%"
94
+ onScroll={handleScroll}
95
+ contentStyles={{
96
+ paddingX: 0,
97
+ paddingY: 0
98
+ }}
99
+ >
100
+ {#each demos as entry, index (entry.name)}
101
+ <div
102
+ class="component-page-slot"
103
+ class:component-page-slot-active={index + 1 === page}
104
+ style:height={`${index === demos.length - 1 ? pageHeight : pageStep}px`}
105
+ >
106
+ <ComponentPage {entry} height={pageHeight} />
107
+ </div>
108
+ {/each}
109
+ </ScrollView>
40
110
 
41
111
  <style>
42
- .component-grid-scroll {
43
- width: 100%;
44
- height: 100%;
112
+ .component-page-slot {
113
+ position: relative;
114
+ z-index: 1;
45
115
  min-width: 0;
46
- min-height: 0;
47
- overflow: auto;
116
+ }
117
+
118
+ .component-page-slot-active {
119
+ z-index: 2;
48
120
  }
49
121
  </style>
@@ -1,5 +1,6 @@
1
1
  import type { Component } from 'svelte';
2
- type DemoEntry = {
2
+ import { type ComponentPageEntry } from './ComponentPage.svelte';
3
+ type DemoEntry = ComponentPageEntry & {
3
4
  component: Component;
4
5
  name: string;
5
6
  description: string;
@@ -0,0 +1,74 @@
1
+ <script lang="ts">
2
+ import type { Component } from 'svelte';
3
+
4
+ export type ComponentPageEntry = {
5
+ component: Component;
6
+ name: string;
7
+ description: string;
8
+ };
9
+
10
+ type Props = {
11
+ entry: ComponentPageEntry;
12
+ height?: number;
13
+ };
14
+
15
+ let { entry, height }: Props = $props();
16
+
17
+ const DemoComponent = $derived(entry.component);
18
+ const pageStyle = $derived(height ? `height: ${height}px;` : '');
19
+ </script>
20
+
21
+ <article class="component-page" style={pageStyle}>
22
+ <header class="component-page-header">
23
+ <h1>{entry.name}</h1>
24
+ {#if entry.description}
25
+ <p>{entry.description}</p>
26
+ {/if}
27
+ </header>
28
+
29
+ <section class="component-page-stage" aria-label={`${entry.name} demo`}>
30
+ <DemoComponent />
31
+ </section>
32
+ </article>
33
+
34
+ <style>
35
+ .component-page {
36
+ display: flex;
37
+ min-height: min(42rem, calc(100svh - 8rem));
38
+ min-width: 0;
39
+ flex-direction: column;
40
+ gap: var(--sveltely-gap);
41
+ padding: calc(var(--sveltely-padding-y) * 2) calc(var(--sveltely-padding-x) * 2);
42
+ }
43
+
44
+ .component-page-header {
45
+ display: grid;
46
+ gap: calc(var(--sveltely-gap) * 0.5);
47
+ min-width: 0;
48
+ }
49
+
50
+ h1 {
51
+ color: var(--sveltely-text-primary-color);
52
+ font-size: calc(var(--sveltely-font-size) * 1.6);
53
+ font-weight: 650;
54
+ line-height: 1.1;
55
+ }
56
+
57
+ p {
58
+ max-width: 48rem;
59
+ color: var(--sveltely-text-secondary-color);
60
+ font-size: calc(var(--sveltely-font-size) * 0.95);
61
+ line-height: 1.45;
62
+ }
63
+
64
+ .component-page-stage {
65
+ display: grid;
66
+ min-width: 0;
67
+ min-height: 0;
68
+ flex: 1 1 0;
69
+ place-items: center;
70
+ overflow: auto;
71
+ background: var(--sveltely-background-color);
72
+ padding: calc(var(--sveltely-padding-y) * 2) calc(var(--sveltely-padding-x) * 2);
73
+ }
74
+ </style>
@@ -0,0 +1,13 @@
1
+ import type { Component } from 'svelte';
2
+ export type ComponentPageEntry = {
3
+ component: Component;
4
+ name: string;
5
+ description: string;
6
+ };
7
+ type Props = {
8
+ entry: ComponentPageEntry;
9
+ height?: number;
10
+ };
11
+ declare const ComponentPage: Component<Props, {}, "">;
12
+ type ComponentPage = ReturnType<typeof ComponentPage>;
13
+ export default ComponentPage;
@@ -1,6 +1,5 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from 'svelte';
3
- import HStack from '../Library/HStack';
4
3
  import VStack from '../Library/VStack';
5
4
 
6
5
  type Props = {
@@ -13,10 +12,7 @@
13
12
  </script>
14
13
 
15
14
  <VStack
16
- minHeight={14}
17
15
  height="100%"
18
- shrink={0}
19
- align="stretch"
20
16
  gap={5}
21
17
  border="1px solid var(--sveltely-border-color)"
22
18
  borderRadius={7.5}
@@ -34,9 +30,9 @@
34
30
  {/if}
35
31
  <div class="hero-card-content">
36
32
  {#if children}
37
- <HStack width="100%" height="100%" minWidth="min-content" align="center" justify="center">
33
+ <div class="hero-card-inner">
38
34
  {@render children()}
39
- </HStack>
35
+ </div>
40
36
  {/if}
41
37
  </div>
42
38
  </VStack>
@@ -57,4 +53,12 @@
57
53
  flex: 1 1 0;
58
54
  overflow: hidden;
59
55
  }
56
+
57
+ .hero-card-inner {
58
+ display: flex;
59
+ width: 100%;
60
+ height: 100%;
61
+ align-items: center;
62
+ justify-content: center;
63
+ }
60
64
  </style>
@@ -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
- <div class="vstack gap-2">
26
- <div class="hstack items-center justify-between gap-3">
26
+ <VStack width="100%" gap={5}>
27
+ <VStack width="100%" gap={5}>
28
+ <HStack width="100%" 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
- </div>
32
+ </HStack>
30
33
  <Slider bind:value={fontSize} min={5} max={20} step={0.5} />
31
- </div>
32
- <div class="vstack gap-2">
33
- <div class="hstack items-center justify-between gap-3">
34
+ </VStack>
35
+ <VStack width="100%" gap={5}>
36
+ <HStack width="100%" 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
- </div>
40
+ </HStack>
37
41
  <Slider bind:value={borderRadius} min={0} max={30} step={0.5} />
38
- </div>
39
- <div class="vstack gap-2">
40
- <div class="hstack items-center justify-between gap-3">
42
+ </VStack>
43
+ <VStack width="100%" gap={5}>
44
+ <HStack width="100%" 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
- </div>
48
+ </HStack>
44
49
  <Slider bind:value={paddingX} min={0} max={20} step="any" />
45
- </div>
46
- <div class="vstack gap-2">
47
- <div class="hstack items-center justify-between gap-3">
50
+ </VStack>
51
+ <VStack width="100%" gap={5}>
52
+ <HStack width="100%" 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
- </div>
56
+ </HStack>
51
57
  <Slider bind:value={paddingY} min={0} max={20} step="any" />
52
- </div>
53
- <div class="vstack gap-2">
54
- <div class="hstack items-center justify-between gap-3">
58
+ </VStack>
59
+ <VStack width="100%" gap={5}>
60
+ <HStack width="100%" 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
- </div>
64
+ </HStack>
58
65
  <Slider bind:value={gap} min={0} max={20} step="any" />
59
- </div>
60
- <div class="vstack gap-2">
61
- <div class="hstack items-center justify-between gap-3">
66
+ </VStack>
67
+ <VStack width="100%" gap={5}>
68
+ <HStack width="100%" 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
- </div>
72
+ </HStack>
65
73
  <Slider bind:value={inset} min={0} max={10} step="any" />
66
- </div>
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, LayoutJustification, LayoutSize } from './style/layout';
9
- export type { LayoutAlignmentValue, LayoutJustificationValue, LayoutProps, LayoutSizeValue } from './style/layout';
8
+ export { Axis, LayoutDimension } from './style/layout';
9
+ export type { AxisValue, LayoutAxis, LayoutAxisBehavior, LayoutDimensionValue, LayoutProps } 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';
@@ -18,6 +18,9 @@ export type { TextAlignmentValue, TextAsValue, TextProps } from './style/text';
18
18
  export { TextFieldType, TextInputMode } from './style/text-editor';
19
19
  export type { TextEditorProps, TextFieldTypeValue, TextInputModeValue } from './style/text-editor';
20
20
  export type { TooltipProps } from './style/tooltip';
21
+ export * from './viewport';
22
+ export { default as Accordion } from './components/Library/Accordion';
23
+ export type { AccordionState } from './components/Library/Accordion';
21
24
  export { default as AnimatedNumber } from './components/Library/AnimatedNumber';
22
25
  export * from './components/Library/ArticleEditor';
23
26
  export { default as Button } from './components/Library/Button';
@@ -33,6 +36,8 @@ export type { ImageMaskValue } from './components/Library/ImageMask';
33
36
  export { default as Label } from './components/Library/Label';
34
37
  export { default as Link } from './components/Library/Link';
35
38
  export { default as NavigationStack } from './components/Library/NavigationStack';
39
+ export { default as Notifications } from './components/Library/Notifications';
40
+ export type { NotificationItem, NotificationTone } from './components/Library/Notifications';
36
41
  export { default as NumberField } from './components/Library/NumberField';
37
42
  export { default as SegmentedPicker } from './components/Library/SegmentedPicker';
38
43
  export { default as Pagination } from './components/Library/Pagination';
@@ -59,6 +64,6 @@ export { default as Calendar } from './components/Library/Calendar';
59
64
  export { default as AsyncButton } from './components/Library/AsyncButton';
60
65
  export { default as SearchField } from './components/Library/SearchField';
61
66
  export { default as ScrollView } from './components/Library/ScrollView';
62
- export type { ScrollGeometry } from './components/Library/ScrollView';
67
+ export type { ScrollContentSize, ScrollGeometry, ScrollViewHandle, ScrollViewOverscrollBehavior } from './components/Library/ScrollView';
63
68
  export { default as TokenSearchField } from './components/Library/TokenSearchField';
64
69
  export { default as VStack } from './components/Library/VStack';
package/dist/index.js CHANGED
@@ -2,12 +2,14 @@ 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, LayoutJustification, LayoutSize } from './style/layout';
5
+ export { Axis, LayoutDimension } 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';
9
9
  export { TextAlignment, TextAs } from './style/text';
10
10
  export { TextFieldType, TextInputMode } from './style/text-editor';
11
+ export * from './viewport';
12
+ export { default as Accordion } from './components/Library/Accordion';
11
13
  export { default as AnimatedNumber } from './components/Library/AnimatedNumber';
12
14
  export * from './components/Library/ArticleEditor';
13
15
  export { default as Button } from './components/Library/Button';
@@ -22,6 +24,7 @@ export { default as ImageMask } from './components/Library/ImageMask';
22
24
  export { default as Label } from './components/Library/Label';
23
25
  export { default as Link } from './components/Library/Link';
24
26
  export { default as NavigationStack } from './components/Library/NavigationStack';
27
+ export { default as Notifications } from './components/Library/Notifications';
25
28
  export { default as NumberField } from './components/Library/NumberField';
26
29
  export { default as SegmentedPicker } from './components/Library/SegmentedPicker';
27
30
  export { default as Pagination } from './components/Library/Pagination';
@@ -89,11 +89,11 @@
89
89
  }
90
90
 
91
91
  .vstack {
92
- @apply flex min-h-0 min-w-0 flex-col;
92
+ @apply inline-flex min-h-0 min-w-0 flex-col;
93
93
  }
94
94
 
95
95
  .hstack {
96
- @apply flex min-h-0 min-w-0 flex-row;
96
+ @apply inline-flex min-h-0 min-w-0 flex-row;
97
97
  }
98
98
 
99
99
  .button,
@@ -119,7 +119,6 @@
119
119
  }
120
120
 
121
121
  .overflow-auto > .vstack,
122
- .overflow-auto > .hstack,
123
- .overflow-auto > .grid {
122
+ .overflow-auto > .hstack {
124
123
  flex-shrink: 0;
125
124
  }