@x33025/sveltely 0.1.17 → 0.1.19

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 (153) hide show
  1. package/dist/actions/LoaderOverlay.svelte +33 -8
  2. package/dist/actions/LoaderOverlay.svelte.d.ts +3 -0
  3. package/dist/actions/loader.d.ts +3 -0
  4. package/dist/actions/loader.js +20 -7
  5. package/dist/components/Library/AnimatedNumber/AnimatedNumber.demo.svelte +3 -9
  6. package/dist/components/Library/ArticleEditor/ArticleEditor.svelte +3 -3
  7. package/dist/components/Library/ArticleEditor/ArticleEditorBody.svelte +59 -74
  8. package/dist/components/Library/ArticleEditor/ArticleEditorHeader.svelte +21 -31
  9. package/dist/components/Library/ArticleEditor/{ArticleBlockCode.svelte → Blocks/Code.svelte} +2 -3
  10. package/dist/components/Library/ArticleEditor/Blocks/Code.svelte.d.ts +8 -0
  11. package/dist/components/Library/ArticleEditor/{ArticleBlockFAQ.svelte → Blocks/FAQ.svelte} +3 -3
  12. package/dist/components/Library/ArticleEditor/Blocks/FAQ.svelte.d.ts +8 -0
  13. package/dist/components/Library/ArticleEditor/{ArticleBlockHeading.svelte → Blocks/Heading.svelte} +9 -9
  14. package/dist/components/Library/ArticleEditor/{ArticleBlockHeading.svelte.d.ts → Blocks/Heading.svelte.d.ts} +4 -4
  15. package/dist/components/Library/ArticleEditor/Blocks/Image.svelte +32 -0
  16. package/dist/components/Library/ArticleEditor/Blocks/Image.svelte.d.ts +10 -0
  17. package/dist/components/Library/ArticleEditor/{ArticleBlockList.svelte → Blocks/List.svelte} +4 -4
  18. package/dist/components/Library/ArticleEditor/{ArticleBlockList.svelte.d.ts → Blocks/List.svelte.d.ts} +4 -4
  19. package/dist/components/Library/ArticleEditor/{ArticleBlockParagraph.svelte → Blocks/Paragraph.svelte} +3 -3
  20. package/dist/components/Library/ArticleEditor/{ArticleBlockFallback.svelte.d.ts → Blocks/Paragraph.svelte.d.ts} +4 -4
  21. package/dist/components/Library/ArticleEditor/{ArticleBlockTable.svelte → Blocks/Table.svelte} +1 -1
  22. package/dist/components/Library/ArticleEditor/{ArticleBlockTable.svelte.d.ts → Blocks/Table.svelte.d.ts} +4 -4
  23. package/dist/components/Library/ArticleEditor/Blocks/index.d.ts +7 -0
  24. package/dist/components/Library/ArticleEditor/Blocks/index.js +7 -0
  25. package/dist/components/Library/ArticleEditor/index.d.ts +1 -9
  26. package/dist/components/Library/ArticleEditor/index.js +1 -9
  27. package/dist/components/Library/AsyncButton/AsyncButton.demo.svelte +2 -6
  28. package/dist/components/Library/AsyncButton/AsyncButton.svelte +9 -5
  29. package/dist/components/Library/AsyncButton/AsyncButton.svelte.d.ts +2 -1
  30. package/dist/components/Library/Button/Button.demo.svelte +2 -17
  31. package/dist/components/Library/Button/Button.demo.svelte.d.ts +0 -1
  32. package/dist/components/Library/Button/Button.svelte +15 -16
  33. package/dist/components/Library/Button/Button.svelte.d.ts +2 -1
  34. package/dist/components/Library/Calendar/Calendar.svelte +17 -27
  35. package/dist/components/Library/Checkbox/Checkbox.demo.svelte +7 -4
  36. package/dist/components/Library/Checkbox/Checkbox.svelte +24 -61
  37. package/dist/components/Library/Checkbox/Checkbox.svelte.d.ts +2 -4
  38. package/dist/components/Library/ChipInput/ChipInput.demo.svelte +2 -2
  39. package/dist/components/Library/ChipInput/ChipInput.svelte +7 -11
  40. package/dist/components/Library/ChipInput/ChipInput.svelte.d.ts +3 -2
  41. package/dist/components/Library/Dropdown/Action.svelte +1 -1
  42. package/dist/components/Library/Dropdown/Dropdown.demo.svelte +10 -10
  43. package/dist/components/Library/Dropdown/Dropdown.svelte +2 -6
  44. package/dist/components/Library/Dropdown/Item.svelte +2 -2
  45. package/dist/components/Library/Dropdown/Section.svelte +1 -1
  46. package/dist/components/Library/Dropdown/Trigger.svelte +3 -7
  47. package/dist/components/Library/Image/Image.demo.svelte +3 -3
  48. package/dist/components/Library/Image/Image.svelte +57 -12
  49. package/dist/components/Library/Image/Image.svelte.d.ts +1 -2
  50. package/dist/components/Library/Image/ImagePlaceholder.demo.svelte +12 -0
  51. package/dist/components/Library/Image/ImagePlaceholder.demo.svelte.d.ts +23 -0
  52. package/dist/components/Library/Image/ImagePlaceholder.svelte +28 -4
  53. package/dist/components/Library/Image/ImagePlaceholder.svelte.d.ts +1 -1
  54. package/dist/components/Library/Image/index.d.ts +1 -0
  55. package/dist/components/Library/Image/index.js +1 -0
  56. package/dist/components/Library/ImageMask/BrushPreview.svelte +6 -6
  57. package/dist/components/Library/ImageMask/ImageMask.demo.svelte +10 -8
  58. package/dist/components/Library/ImageMask/ImageMask.svelte +14 -6
  59. package/dist/components/Library/ImageMask/ImageMask.svelte.d.ts +1 -2
  60. package/dist/components/Library/ImageMask/MaskLayer.svelte +12 -6
  61. package/dist/components/Library/Label/Label.demo.svelte +9 -3
  62. package/dist/components/Library/Label/Label.svelte +8 -2
  63. package/dist/components/Library/Link/Link.svelte +10 -22
  64. package/dist/components/Library/Link/Link.svelte.d.ts +2 -3
  65. package/dist/components/Library/Loader/Loader.demo.svelte +9 -3
  66. package/dist/components/Library/NavigationStack/Link.svelte +8 -12
  67. package/dist/components/Library/NavigationStack/Link.svelte.d.ts +1 -3
  68. package/dist/components/Library/NavigationStack/SidebarToggle.svelte +8 -2
  69. package/dist/components/Library/NumberField/NumberField.svelte +21 -17
  70. package/dist/components/Library/NumberField/NumberField.svelte.d.ts +4 -2
  71. package/dist/components/Library/Pagination/Pagination.svelte +3 -3
  72. package/dist/components/Library/Popover/Popover.svelte +2 -7
  73. package/dist/components/Library/ScrollView/ScrollView.demo.svelte +50 -0
  74. package/dist/components/Library/ScrollView/ScrollView.demo.svelte.d.ts +10 -0
  75. package/dist/components/Library/ScrollView/ScrollView.svelte +414 -67
  76. package/dist/components/Library/ScrollView/ScrollView.svelte.d.ts +17 -1
  77. package/dist/components/Library/ScrollView/index.d.ts +1 -1
  78. package/dist/components/Library/SearchField/SearchField.demo.svelte +2 -2
  79. package/dist/components/Library/SearchField/SearchField.svelte +9 -4
  80. package/dist/components/Library/SearchField/SearchField.svelte.d.ts +2 -1
  81. package/dist/components/Library/SegmentedPicker/SegmentedPicker.demo.svelte +2 -2
  82. package/dist/components/Library/SegmentedPicker/SegmentedPicker.svelte +7 -7
  83. package/dist/components/Library/Sheet/Sheet.demo.svelte +1 -1
  84. package/dist/components/Library/Sheet/Sheet.svelte +2 -7
  85. package/dist/components/Library/Slider/Slider.demo.svelte +1 -1
  86. package/dist/components/Library/Slider/Slider.svelte +11 -7
  87. package/dist/components/Library/Slider/Slider.svelte.d.ts +2 -1
  88. package/dist/components/Library/Spinner/Spinner.demo.svelte +1 -1
  89. package/dist/components/Library/Switch/Switch.demo.svelte +7 -4
  90. package/dist/components/Library/Switch/Switch.svelte +28 -68
  91. package/dist/components/Library/Switch/Switch.svelte.d.ts +2 -4
  92. package/dist/components/Library/Table/Column.svelte +81 -0
  93. package/dist/components/Library/Table/Column.svelte.d.ts +39 -0
  94. package/dist/components/Library/Table/Table.demo.svelte +148 -0
  95. package/dist/components/Library/Table/Table.demo.svelte.d.ts +10 -0
  96. package/dist/components/Library/Table/Table.svelte +624 -0
  97. package/dist/components/Library/Table/Table.svelte.d.ts +42 -0
  98. package/dist/components/Library/Table/context.d.ts +5 -0
  99. package/dist/components/Library/Table/context.js +2 -0
  100. package/dist/components/Library/Table/index.js +5 -0
  101. package/dist/components/Library/Table/types.d.ts +37 -0
  102. package/dist/components/Library/Table/types.js +1 -0
  103. package/dist/components/Library/Text/Text.demo.svelte +21 -0
  104. package/dist/components/Library/Text/Text.demo.svelte.d.ts +24 -0
  105. package/dist/components/Library/Text/Text.svelte +41 -0
  106. package/dist/components/Library/Text/Text.svelte.d.ts +9 -0
  107. package/dist/components/Library/Text/index.d.ts +1 -0
  108. package/dist/components/Library/Text/index.js +1 -0
  109. package/dist/components/Library/TextEditor/TextEditor.svelte +15 -9
  110. package/dist/components/Library/TextEditor/TextEditor.svelte.d.ts +2 -4
  111. package/dist/components/Library/TextField/TextField.demo.svelte +1 -1
  112. package/dist/components/Library/TextField/TextField.svelte +21 -18
  113. package/dist/components/Library/TextField/TextField.svelte.d.ts +4 -2
  114. package/dist/components/Library/TextShimmer/TextShimmer.demo.svelte +1 -1
  115. package/dist/components/Library/TimePicker/TimePicker.demo.svelte +10 -2
  116. package/dist/components/Library/TimePicker/TimePicker.svelte +10 -5
  117. package/dist/components/Library/TokenSearchField/TokenSearchField.demo.svelte +4 -2
  118. package/dist/components/Library/TokenSearchField/TokenSearchField.svelte +11 -11
  119. package/dist/components/Library/TokenSearchField/TokenSearchField.svelte.d.ts +2 -1
  120. package/dist/components/Library/WheelPicker/WheelColumn.svelte +183 -126
  121. package/dist/components/Library/WheelPicker/WheelPicker.svelte +4 -4
  122. package/dist/components/Library/WheelPicker/WheelPicker.svelte.d.ts +2 -2
  123. package/dist/components/Library/WheelPicker/index.d.ts +1 -1
  124. package/dist/components/Library/WheelPicker/types.d.ts +6 -0
  125. package/dist/components/Local/ColorStyleControls.svelte +201 -0
  126. package/dist/components/Local/ColorStyleControls.svelte.d.ts +13 -0
  127. package/dist/components/Local/HeroCard.svelte +3 -3
  128. package/dist/components/Local/LayoutStyleControls.svelte +67 -0
  129. package/dist/components/Local/LayoutStyleControls.svelte.d.ts +11 -0
  130. package/dist/components/Local/StyleControls.svelte +48 -124
  131. package/dist/components/Local/StyleControls.svelte.d.ts +7 -5
  132. package/dist/index.d.ts +9 -2
  133. package/dist/index.js +5 -1
  134. package/dist/style/index.css +7 -12
  135. package/dist/style/label.d.ts +2 -1
  136. package/dist/style/label.js +2 -1
  137. package/dist/style/surface.js +4 -0
  138. package/dist/style/text-editor.d.ts +2 -13
  139. package/dist/style/text-editor.js +1 -12
  140. package/dist/style/text.d.ts +26 -0
  141. package/dist/style/text.js +69 -0
  142. package/dist/style/tooltip.d.ts +4 -0
  143. package/dist/style/tooltip.js +1 -0
  144. package/dist/style.css +41 -114
  145. package/package.json +1 -1
  146. package/dist/components/Library/ArticleEditor/ArticleBlockCode.svelte.d.ts +0 -8
  147. package/dist/components/Library/ArticleEditor/ArticleBlockFAQ.svelte.d.ts +0 -8
  148. package/dist/components/Library/ArticleEditor/ArticleBlockFallback.svelte +0 -79
  149. package/dist/components/Library/ArticleEditor/ArticleBlockImage.svelte +0 -48
  150. package/dist/components/Library/ArticleEditor/ArticleBlockImage.svelte.d.ts +0 -9
  151. package/dist/components/Library/ArticleEditor/ArticleBlockParagraph.svelte.d.ts +0 -15
  152. package/dist/components/Library/ArticleEditor/ArticleImagePreview.svelte +0 -71
  153. package/dist/components/Library/ArticleEditor/ArticleImagePreview.svelte.d.ts +0 -8
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
- import TextEditor from '../TextEditor';
3
- import type { BlockDraft } from './types.js';
2
+ import TextEditor from '../../TextEditor';
3
+ import type { BlockDraft } from '../types.js';
4
4
 
5
5
  let {
6
6
  block,
@@ -26,6 +26,7 @@
26
26
  </script>
27
27
 
28
28
  <TextEditor
29
+ as="paragraph"
29
30
  autosize
30
31
  rows={1}
31
32
  value={block.text ?? ''}
@@ -74,6 +75,5 @@
74
75
  {shouldFocus}
75
76
  {focusPosition}
76
77
  {onFocused}
77
- className="text-[17px] leading-8 text-zinc-700 placeholder:text-zinc-300"
78
78
  placeholder="Type something thoughtful..."
79
79
  />
@@ -1,4 +1,4 @@
1
- import type { BlockDraft } from './types.js';
1
+ import type { BlockDraft } from '../types.js';
2
2
  type $$ComponentProps = {
3
3
  block: BlockDraft;
4
4
  onUpdate: (id: string, patch: Partial<BlockDraft>) => void;
@@ -10,6 +10,6 @@ type $$ComponentProps = {
10
10
  focusPosition?: number | null;
11
11
  onFocused?: () => void;
12
12
  };
13
- declare const ArticleBlockFallback: import("svelte").Component<$$ComponentProps, {}, "">;
14
- type ArticleBlockFallback = ReturnType<typeof ArticleBlockFallback>;
15
- export default ArticleBlockFallback;
13
+ declare const Paragraph: import("svelte").Component<$$ComponentProps, {}, "">;
14
+ type Paragraph = ReturnType<typeof Paragraph>;
15
+ export default Paragraph;
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { Plus, Trash2 } from '@lucide/svelte';
3
- import type { BlockDraft } from './types.js';
3
+ import type { BlockDraft } from '../types.js';
4
4
 
5
5
  let { block, onUpdateHeader, onUpdateCell, onAddColumn, onAddRow, onRemoveColumn, onRemoveRow } =
6
6
  $props<{
@@ -1,4 +1,4 @@
1
- import type { BlockDraft } from './types.js';
1
+ import type { BlockDraft } from '../types.js';
2
2
  type $$ComponentProps = {
3
3
  block: BlockDraft;
4
4
  onUpdateHeader: (blockID: string, cellIndex: number, value: string) => void;
@@ -8,6 +8,6 @@ type $$ComponentProps = {
8
8
  onRemoveColumn: (blockID: string, columnIndex: number) => void;
9
9
  onRemoveRow: (blockID: string, rowIndex: number) => void;
10
10
  };
11
- declare const ArticleBlockTable: import("svelte").Component<$$ComponentProps, {}, "">;
12
- type ArticleBlockTable = ReturnType<typeof ArticleBlockTable>;
13
- export default ArticleBlockTable;
11
+ declare const Table: import("svelte").Component<$$ComponentProps, {}, "">;
12
+ type Table = ReturnType<typeof Table>;
13
+ export default Table;
@@ -0,0 +1,7 @@
1
+ export { default as Code } from './Code.svelte';
2
+ export { default as FAQ } from './FAQ.svelte';
3
+ export { default as Heading } from './Heading.svelte';
4
+ export { default as Image } from './Image.svelte';
5
+ export { default as List } from './List.svelte';
6
+ export { default as Paragraph } from './Paragraph.svelte';
7
+ export { default as Table } from './Table.svelte';
@@ -0,0 +1,7 @@
1
+ export { default as Code } from './Code.svelte';
2
+ export { default as FAQ } from './FAQ.svelte';
3
+ export { default as Heading } from './Heading.svelte';
4
+ export { default as Image } from './Image.svelte';
5
+ export { default as List } from './List.svelte';
6
+ export { default as Paragraph } from './Paragraph.svelte';
7
+ export { default as Table } from './Table.svelte';
@@ -1,18 +1,10 @@
1
1
  export { default as ArticleEditor } from './ArticleEditor.svelte';
2
2
  export { default as ArticleEditorBody } from './ArticleEditorBody.svelte';
3
- export { default as ArticleBlockCode } from './ArticleBlockCode.svelte';
4
- export { default as ArticleBlockFAQ } from './ArticleBlockFAQ.svelte';
5
- export { default as ArticleBlockFallback } from './ArticleBlockFallback.svelte';
6
- export { default as ArticleBlockHeading } from './ArticleBlockHeading.svelte';
7
- export { default as ArticleBlockImage } from './ArticleBlockImage.svelte';
8
3
  export { default as ArticleBlockInsertControl } from './ArticleBlockInsertControl.svelte';
9
4
  export { default as ArticleBlockDragControl } from './ArticleBlockDragControl.svelte';
10
- export { default as ArticleBlockList } from './ArticleBlockList.svelte';
11
- export { default as ArticleBlockParagraph } from './ArticleBlockParagraph.svelte';
12
5
  export { default as ArticleBlockShell } from './ArticleBlockShell.svelte';
13
- export { default as ArticleBlockTable } from './ArticleBlockTable.svelte';
6
+ export * as Blocks from './Blocks';
14
7
  export { default as ArticleEditorHeader } from './ArticleEditorHeader.svelte';
15
- export { default as ArticleImagePreview } from './ArticleImagePreview.svelte';
16
8
  export { articleBlockLabel, createArticleEditor } from './articleEditor.svelte.js';
17
9
  export type { BlockInsertKind, BlockTextFormat } from './articleEditor.svelte.js';
18
10
  export type { ArticleBlock, ArticleEditorArticle, BlockDraft } from './types.js';
@@ -1,16 +1,8 @@
1
1
  export { default as ArticleEditor } from './ArticleEditor.svelte';
2
2
  export { default as ArticleEditorBody } from './ArticleEditorBody.svelte';
3
- export { default as ArticleBlockCode } from './ArticleBlockCode.svelte';
4
- export { default as ArticleBlockFAQ } from './ArticleBlockFAQ.svelte';
5
- export { default as ArticleBlockFallback } from './ArticleBlockFallback.svelte';
6
- export { default as ArticleBlockHeading } from './ArticleBlockHeading.svelte';
7
- export { default as ArticleBlockImage } from './ArticleBlockImage.svelte';
8
3
  export { default as ArticleBlockInsertControl } from './ArticleBlockInsertControl.svelte';
9
4
  export { default as ArticleBlockDragControl } from './ArticleBlockDragControl.svelte';
10
- export { default as ArticleBlockList } from './ArticleBlockList.svelte';
11
- export { default as ArticleBlockParagraph } from './ArticleBlockParagraph.svelte';
12
5
  export { default as ArticleBlockShell } from './ArticleBlockShell.svelte';
13
- export { default as ArticleBlockTable } from './ArticleBlockTable.svelte';
6
+ export * as Blocks from './Blocks';
14
7
  export { default as ArticleEditorHeader } from './ArticleEditorHeader.svelte';
15
- export { default as ArticleImagePreview } from './ArticleImagePreview.svelte';
16
8
  export { articleBlockLabel, createArticleEditor } from './articleEditor.svelte.js';
@@ -1,6 +1,6 @@
1
1
  <script module lang="ts">
2
2
  export const demo = {
3
- name: 'AsyncButton',
3
+ name: 'Async Button',
4
4
  description: 'Async action button with loading and error states.'
5
5
  };
6
6
  </script>
@@ -16,8 +16,4 @@
16
16
  };
17
17
  </script>
18
18
 
19
- <AsyncButton
20
- icon={SaveIcon}
21
- label="Run async action"
22
- action={runDemo}
23
- />
19
+ <AsyncButton icon={SaveIcon} label="Run async action" action={runDemo} />
@@ -2,10 +2,10 @@
2
2
  import { CircleAlertIcon } from '@lucide/svelte';
3
3
  import type { Component } from 'svelte';
4
4
  import type { HTMLButtonAttributes } from 'svelte/elements';
5
- import { tooltip } from '../../../actions/tooltip';
6
5
  import Button from '../Button';
7
6
  import Spinner from '../Spinner';
8
7
  import { extractStyleProps, type StyleProps } from '../../../style/surface';
8
+ import type { TooltipProps } from '../../../style/tooltip';
9
9
 
10
10
  type Props = {
11
11
  icon?: Component<{ class?: string; size?: number | string }>;
@@ -19,6 +19,7 @@
19
19
  iconSize?: number | string;
20
20
  labelColor?: string;
21
21
  } & StyleProps &
22
+ TooltipProps &
22
23
  Omit<HTMLButtonAttributes, 'children' | 'onclick' | 'class' | 'style'>;
23
24
 
24
25
  let {
@@ -32,6 +33,7 @@
32
33
  iconColor,
33
34
  iconSize,
34
35
  labelColor,
36
+ tooltip,
35
37
  disabled = false,
36
38
  type = 'button',
37
39
  ...restProps
@@ -48,9 +50,9 @@
48
50
  const effectiveDisabled = $derived(disabled || (disableWhileLoading && effectiveLoading));
49
51
  const buttonStyleProps = $derived({
50
52
  ...styleProps,
51
- background: styleProps.background ?? 'var(--sveltely-active-color)',
52
- borderColor: styleProps.borderColor ?? 'var(--sveltely-active-color)',
53
- color: styleProps.color ?? 'var(--sveltely-background-color)'
53
+ background: styleProps.background ?? 'var(--sveltely-control-active-color)',
54
+ borderColor: styleProps.borderColor ?? 'var(--sveltely-control-active-color)',
55
+ color: styleProps.color ?? 'var(--sveltely-control-background-color)'
54
56
  });
55
57
 
56
58
  const handleClick = async () => {
@@ -81,6 +83,7 @@
81
83
  if (error instanceof Error && error.message.trim().length > 0) return error.message;
82
84
  return 'Something went wrong';
83
85
  });
86
+ const resolvedTooltip = $derived(errorLabel ? { label: errorLabel } : tooltip);
84
87
 
85
88
  const toRem = (value: number | string | undefined) =>
86
89
  value === undefined ? undefined : typeof value === 'number' ? `${value}rem` : value;
@@ -106,10 +109,11 @@
106
109
  });
107
110
  </script>
108
111
 
109
- <span use:tooltip={{ label: errorLabel ?? '', disabled: !errorLabel }} class="async-button">
112
+ <span class="async-button">
110
113
  <Button
111
114
  {type}
112
115
  {...buttonStyleProps}
116
+ tooltip={resolvedTooltip}
113
117
  disabled={effectiveDisabled}
114
118
  aria-busy={effectiveLoading}
115
119
  aria-label={variant === 'iconOnly' ? label : undefined}
@@ -1,6 +1,7 @@
1
1
  import type { Component } from 'svelte';
2
2
  import type { HTMLButtonAttributes } from 'svelte/elements';
3
3
  import { type StyleProps } from '../../../style/surface';
4
+ import type { TooltipProps } from '../../../style/tooltip';
4
5
  type Props = {
5
6
  icon?: Component<{
6
7
  class?: string;
@@ -15,7 +16,7 @@ type Props = {
15
16
  iconColor?: string;
16
17
  iconSize?: number | string;
17
18
  labelColor?: string;
18
- } & StyleProps & Omit<HTMLButtonAttributes, 'children' | 'onclick' | 'class' | 'style'>;
19
+ } & StyleProps & TooltipProps & Omit<HTMLButtonAttributes, 'children' | 'onclick' | 'class' | 'style'>;
19
20
  declare const AsyncButton: Component<Props, {}, "error">;
20
21
  type AsyncButton = ReturnType<typeof AsyncButton>;
21
22
  export default AsyncButton;
@@ -1,27 +1,12 @@
1
1
  <script module lang="ts">
2
2
  export const demo = {
3
3
  name: 'Button',
4
- description: 'Token-aware button primitive with composable content.',
5
- columnSpan: 2
4
+ description: 'Basic button component.'
6
5
  };
7
6
  </script>
8
7
 
9
8
  <script lang="ts">
10
- import { SaveIcon } from '@lucide/svelte';
11
9
  import Button from './Button.svelte';
12
- import HStack from '../HStack';
13
10
  </script>
14
11
 
15
- <HStack align="center" gap={7.5}>
16
- <Button label="Default" />
17
- <Button
18
- label="Solid"
19
- background="var(--sveltely-active-color)"
20
- borderColor="var(--sveltely-active-color)"
21
- color="var(--sveltely-background-color)"
22
- />
23
- <Button>
24
- <SaveIcon />
25
- <span>With icon</span>
26
- </Button>
27
- </HStack>
12
+ <Button label="Button" />
@@ -1,7 +1,6 @@
1
1
  export declare const demo: {
2
2
  name: string;
3
3
  description: string;
4
- columnSpan: number;
5
4
  };
6
5
  import Button from './Button.svelte';
7
6
  interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
@@ -1,15 +1,25 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from 'svelte';
3
3
  import type { HTMLButtonAttributes } from 'svelte/elements';
4
+ import { tooltip as tooltipAction } from '../../../actions/tooltip';
4
5
  import { extractStyleProps, surfaceStyle, type StyleProps } from '../../../style/surface';
6
+ import type { TooltipProps } from '../../../style/tooltip';
5
7
 
6
8
  type Props = {
7
9
  children?: Snippet;
8
10
  label?: string;
9
11
  } & StyleProps &
12
+ TooltipProps &
10
13
  Omit<HTMLButtonAttributes, 'children' | 'class' | 'style'>;
11
14
 
12
- let { children, label, disabled = false, type = 'button', ...restProps }: Props = $props();
15
+ let {
16
+ children,
17
+ label,
18
+ tooltip,
19
+ disabled = false,
20
+ type = 'button',
21
+ ...restProps
22
+ }: Props = $props();
13
23
 
14
24
  const extractedStyleProps = $derived.by(() => extractStyleProps(restProps));
15
25
  const styleProps = $derived(extractedStyleProps.styleProps);
@@ -40,6 +50,7 @@
40
50
  style={rootStyle}
41
51
  {disabled}
42
52
  {...props}
53
+ use:tooltipAction={tooltip}
43
54
  >
44
55
  {#if children}
45
56
  {@render children()}
@@ -55,8 +66,8 @@
55
66
  --button-icon-size: calc(var(--button-font-size) * 1.143);
56
67
  border: 1px solid var(--button-border-color, var(--sveltely-border-color));
57
68
  border-radius: var(--button-border-radius, var(--sveltely-border-radius));
58
- background: var(--button-background, var(--sveltely-background-color));
59
- color: var(--button-color, var(--sveltely-primary-color));
69
+ background: var(--button-background, var(--sveltely-control-background-color));
70
+ color: var(--button-color, var(--sveltely-text-primary-color));
60
71
  gap: var(--button-gap, var(--sveltely-gap));
61
72
  font-size: var(--button-font-size);
62
73
  line-height: 1.25;
@@ -64,19 +75,7 @@
64
75
  var(--button-padding-x, calc(var(--sveltely-padding-x) * var(--button-scale)));
65
76
  transition:
66
77
  color 150ms,
67
- border-color 150ms,
68
- background-color 150ms;
69
- }
70
-
71
- .button:hover {
72
- background: var(
73
- --button-hover-background,
74
- color-mix(
75
- in oklab,
76
- var(--button-background, var(--sveltely-background-color)) 88%,
77
- var(--button-color, var(--sveltely-primary-color))
78
- )
79
- );
78
+ border-color 150ms;
80
79
  }
81
80
 
82
81
  .button-icon-only {
@@ -1,10 +1,11 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  import type { HTMLButtonAttributes } from 'svelte/elements';
3
3
  import { type StyleProps } from '../../../style/surface';
4
+ import type { TooltipProps } from '../../../style/tooltip';
4
5
  type Props = {
5
6
  children?: Snippet;
6
7
  label?: string;
7
- } & StyleProps & Omit<HTMLButtonAttributes, 'children' | 'class' | 'style'>;
8
+ } & StyleProps & TooltipProps & Omit<HTMLButtonAttributes, 'children' | 'class' | 'style'>;
8
9
  declare const Button: import("svelte").Component<Props, {}, "">;
9
10
  type Button = ReturnType<typeof Button>;
10
11
  export default Button;
@@ -164,9 +164,9 @@
164
164
  --calendar-font-size: calc(var(--sveltely-font-size) * 0.971);
165
165
  --calendar-scale: calc(var(--calendar-font-size) / 1rem);
166
166
  --calendar-cell-core-size: max(2ch, calc(2ch * var(--calendar-scale)));
167
- --calendar-weekend-color: var(--sveltely-secondary-color);
168
- --calendar-weekend-header-color: var(--sveltely-secondary-color);
169
- --calendar-weekend-selected-color: var(--sveltely-background-color);
167
+ --calendar-weekend-color: var(--sveltely-text-secondary-color);
168
+ --calendar-weekend-header-color: var(--sveltely-text-secondary-color);
169
+ --calendar-weekend-selected-color: var(--sveltely-control-background-color);
170
170
  --calendar-cell-width: calc(var(--calendar-cell-core-size) + (var(--sveltely-padding-x) * 2.2));
171
171
  --calendar-cell-height: calc(
172
172
  var(--calendar-cell-core-size) + (var(--sveltely-padding-y) * 2.2)
@@ -193,7 +193,7 @@
193
193
  font-size: var(--calendar-title-size);
194
194
  line-height: 1.4;
195
195
  font-weight: 600;
196
- color: var(--sveltely-primary-color);
196
+ color: var(--sveltely-text-primary-color);
197
197
  }
198
198
 
199
199
  .calendar-nav-button {
@@ -210,20 +210,19 @@
210
210
  max-height: var(--calendar-cell-height);
211
211
  border: 1px solid color-mix(in oklab, var(--sveltely-border-color) 75%, white);
212
212
  border-radius: var(--sveltely-border-radius);
213
- background: color-mix(in oklab, white 92%, var(--sveltely-inactive-color));
213
+ background: color-mix(in oklab, white 92%, var(--sveltely-control-inactive-color));
214
214
  padding: 0;
215
- color: var(--sveltely-secondary-color);
216
- cursor: pointer;
215
+ color: var(--sveltely-text-secondary-color);
217
216
  appearance: none;
218
217
  }
219
218
 
220
219
  .calendar-nav-button:focus-visible {
221
- outline: 2px solid color-mix(in oklab, var(--sveltely-active-color) 24%, white);
220
+ outline: 2px solid color-mix(in oklab, var(--sveltely-control-active-color) 24%, white);
222
221
  outline-offset: 2px;
223
222
  }
224
223
 
225
224
  .calendar-nav-button:hover {
226
- background: var(--sveltely-hover-color);
225
+ background: color-mix(in oklab, var(--sveltely-control-active-color) 5%, transparent);
227
226
  }
228
227
 
229
228
  .calendar-nav-icon {
@@ -250,7 +249,7 @@
250
249
  font-size: var(--calendar-weekday-size);
251
250
  line-height: 1;
252
251
  text-align: center;
253
- color: var(--sveltely-secondary-color);
252
+ color: var(--sveltely-text-secondary-color);
254
253
  }
255
254
 
256
255
  .calendar-weekday-weekend {
@@ -266,12 +265,11 @@
266
265
  height: 100%;
267
266
  border: 1px solid color-mix(in oklab, var(--sveltely-border-color) 75%, white);
268
267
  border-radius: var(--sveltely-border-radius);
269
- background: color-mix(in oklab, white 92%, var(--sveltely-inactive-color));
268
+ background: color-mix(in oklab, white 92%, var(--sveltely-control-inactive-color));
270
269
  padding: 0;
271
270
  font-size: calc(var(--calendar-font-size) * 0.85);
272
271
  line-height: 1;
273
- color: var(--sveltely-primary-color);
274
- cursor: pointer;
272
+ color: var(--sveltely-text-primary-color);
275
273
  appearance: none;
276
274
  }
277
275
 
@@ -280,32 +278,24 @@
280
278
  }
281
279
 
282
280
  .calendar-day:focus-visible {
283
- outline: 2px solid color-mix(in oklab, var(--sveltely-active-color) 24%, white);
281
+ outline: 2px solid color-mix(in oklab, var(--sveltely-control-active-color) 24%, white);
284
282
  outline-offset: 2px;
285
283
  }
286
284
 
287
- .calendar-day:hover {
288
- background: var(--sveltely-hover-color);
289
- }
290
-
291
285
  .calendar-day-outside {
292
286
  border-color: transparent;
293
287
  background: transparent;
294
- color: var(--sveltely-secondary-color);
288
+ color: var(--sveltely-text-secondary-color);
295
289
  }
296
290
 
297
291
  .calendar-day-today {
298
- border-color: color-mix(in oklab, var(--sveltely-active-color) 18%, white);
292
+ border-color: color-mix(in oklab, var(--sveltely-control-active-color) 18%, white);
299
293
  }
300
294
 
301
295
  .calendar-day-selected {
302
- border-color: var(--sveltely-active-color);
303
- background: var(--sveltely-active-color);
304
- color: var(--sveltely-background-color);
305
- }
306
-
307
- .calendar-day-selected:hover {
308
- background: var(--sveltely-active-hover-color);
296
+ border-color: var(--sveltely-control-active-color);
297
+ background: var(--sveltely-control-active-color);
298
+ color: var(--sveltely-control-background-color);
309
299
  }
310
300
 
311
301
  .calendar-day-selected.calendar-day-weekend {
@@ -7,14 +7,17 @@
7
7
 
8
8
  <script lang="ts">
9
9
  import Checkbox from './Checkbox.svelte';
10
+ import Label from '../Label';
10
11
 
11
12
  let notificationsEnabled = $state(true);
12
13
  let weeklySummaryEnabled = $state(false);
13
14
  </script>
14
15
 
15
16
  <div class="vstack gap-3">
16
- <Checkbox bind:checked={notificationsEnabled} label="Enable notifications" />
17
- <Checkbox bind:checked={weeklySummaryEnabled}>
18
- <span>Send weekly summary email</span>
19
- </Checkbox>
17
+ <Label label="Enable notifications" orientation="leading" width="fit">
18
+ <Checkbox bind:checked={notificationsEnabled} />
19
+ </Label>
20
+ <Label label="Send weekly summary" orientation="leading" width="fit">
21
+ <Checkbox bind:checked={weeklySummaryEnabled} />
22
+ </Label>
20
23
  </div>
@@ -1,23 +1,17 @@
1
1
  <script lang="ts">
2
2
  import { CheckIcon } from '@lucide/svelte';
3
- import type { Snippet } from 'svelte';
4
3
  import type { HTMLInputAttributes } from 'svelte/elements';
4
+ import { tooltip as tooltipAction } from '../../../actions/tooltip';
5
5
  import { extractStyleProps, surfaceStyle, type StyleProps } from '../../../style/surface';
6
+ import type { TooltipProps } from '../../../style/tooltip';
6
7
 
7
8
  type Props = {
8
9
  checked?: boolean;
9
- label?: string;
10
- children?: Snippet;
11
10
  } & StyleProps &
12
- Omit<HTMLInputAttributes, 'type' | 'children' | 'class' | 'style' | 'checked'>;
11
+ TooltipProps &
12
+ Omit<HTMLInputAttributes, 'type' | 'class' | 'style' | 'checked'>;
13
13
 
14
- let {
15
- checked = $bindable(false),
16
- label,
17
- children,
18
- disabled = false,
19
- ...restProps
20
- }: Props = $props();
14
+ let { checked = $bindable(false), tooltip, disabled = false, ...restProps }: Props = $props();
21
15
 
22
16
  const extractedStyleProps = $derived.by(() => extractStyleProps(restProps));
23
17
  const styleProps = $derived(extractedStyleProps.styleProps);
@@ -26,26 +20,15 @@
26
20
  </script>
27
21
 
28
22
  <label
29
- class="checkbox inline-flex items-center"
23
+ class="checkbox"
30
24
  style={rootStyle}
31
25
  data-disabled={disabled ? 'true' : 'false'}
26
+ use:tooltipAction={tooltip}
32
27
  >
33
- <span class="checkbox-control">
34
- <input bind:checked type="checkbox" {disabled} {...props} />
35
- <span class="checkbox-mark" aria-hidden="true">
36
- <CheckIcon class="checkbox-icon" />
37
- </span>
28
+ <input bind:checked type="checkbox" {disabled} {...props} />
29
+ <span class="checkbox-mark" aria-hidden="true">
30
+ <CheckIcon class="checkbox-icon" />
38
31
  </span>
39
-
40
- {#if children || label}
41
- <span class="checkbox-label">
42
- {#if children}
43
- {@render children()}
44
- {:else if label}
45
- {label}
46
- {/if}
47
- </span>
48
- {/if}
49
32
  </label>
50
33
 
51
34
  <style>
@@ -57,11 +40,12 @@
57
40
  (var(--sveltely-padding-y) * 0.28 * var(--checkbox-scale))
58
41
  );
59
42
  --checkbox-icon-size: calc(var(--checkbox-box-size) * 0.64);
60
- gap: var(--checkbox-gap, var(--sveltely-gap));
43
+ display: inline-block;
44
+ position: relative;
45
+ flex: 0 0 auto;
46
+ inline-size: var(--checkbox-box-size);
47
+ block-size: var(--checkbox-box-size);
61
48
  font-size: var(--checkbox-font-size);
62
- line-height: 1.25;
63
- color: var(--checkbox-color, var(--sveltely-primary-color));
64
- cursor: pointer;
65
49
  user-select: none;
66
50
  }
67
51
 
@@ -70,14 +54,7 @@
70
54
  opacity: 0.5;
71
55
  }
72
56
 
73
- .checkbox-control {
74
- position: relative;
75
- flex: 0 0 auto;
76
- inline-size: var(--checkbox-box-size);
77
- block-size: var(--checkbox-box-size);
78
- }
79
-
80
- .checkbox-control input {
57
+ .checkbox input {
81
58
  position: absolute;
82
59
  inset: 0;
83
60
  margin: 0;
@@ -90,34 +67,24 @@
90
67
  block-size: 100%;
91
68
  border: 1px solid var(--checkbox-border-color, var(--sveltely-border-color));
92
69
  border-radius: var(--checkbox-border-radius, calc(var(--sveltely-border-radius) * 0.5));
93
- background: var(--checkbox-background, var(--sveltely-inactive-color));
70
+ background: var(--checkbox-background, var(--sveltely-control-inactive-color));
94
71
  color: transparent;
95
72
  display: inline-flex;
96
73
  align-items: center;
97
74
  justify-content: center;
98
75
  transition:
99
76
  color 150ms,
100
- border-color 150ms,
101
- background-color 150ms;
102
- }
103
-
104
- .checkbox:hover .checkbox-mark {
105
- background: var(--checkbox-hover-background, var(--sveltely-inactive-hover-color));
77
+ border-color 150ms;
106
78
  }
107
79
 
108
- .checkbox-control input:checked + .checkbox-mark {
109
- border-color: var(--checkbox-checked-border-color, var(--sveltely-active-color));
110
- background: var(--checkbox-checked-background, var(--sveltely-active-color));
111
- color: var(--checkbox-checked-color, var(--sveltely-background-color));
80
+ .checkbox input:checked + .checkbox-mark {
81
+ border-color: var(--checkbox-checked-border-color, var(--sveltely-control-active-color));
82
+ background: var(--checkbox-checked-background, var(--sveltely-control-active-color));
83
+ color: var(--checkbox-checked-color, var(--sveltely-control-background-color));
112
84
  }
113
85
 
114
- .checkbox:hover .checkbox-control input:checked + .checkbox-mark {
115
- background: var(--checkbox-checked-hover-background, var(--sveltely-active-hover-color));
116
- border-color: var(--checkbox-checked-hover-border-color, var(--sveltely-active-hover-color));
117
- }
118
-
119
- .checkbox-control input:focus-visible + .checkbox-mark {
120
- outline: 2px solid color-mix(in oklab, var(--sveltely-active-color) 24%, white);
86
+ .checkbox input:focus-visible + .checkbox-mark {
87
+ outline: 2px solid color-mix(in oklab, var(--sveltely-control-active-color) 24%, white);
121
88
  outline-offset: 2px;
122
89
  }
123
90
 
@@ -126,8 +93,4 @@
126
93
  width: var(--checkbox-icon-size);
127
94
  height: var(--checkbox-icon-size);
128
95
  }
129
-
130
- .checkbox-label {
131
- min-width: 0;
132
- }
133
96
  </style>
@@ -1,11 +1,9 @@
1
- import type { Snippet } from 'svelte';
2
1
  import type { HTMLInputAttributes } from 'svelte/elements';
3
2
  import { type StyleProps } from '../../../style/surface';
3
+ import type { TooltipProps } from '../../../style/tooltip';
4
4
  type Props = {
5
5
  checked?: boolean;
6
- label?: string;
7
- children?: Snippet;
8
- } & StyleProps & Omit<HTMLInputAttributes, 'type' | 'children' | 'class' | 'style' | 'checked'>;
6
+ } & StyleProps & TooltipProps & Omit<HTMLInputAttributes, 'type' | 'class' | 'style' | 'checked'>;
9
7
  declare const Checkbox: import("svelte").Component<Props, {}, "checked">;
10
8
  type Checkbox = ReturnType<typeof Checkbox>;
11
9
  export default Checkbox;
@@ -1,6 +1,6 @@
1
1
  <script module lang="ts">
2
2
  export const demo = {
3
- name: 'ChipInput',
3
+ name: 'Chip Input',
4
4
  description: 'Editable chip list with bindable tags.'
5
5
  };
6
6
  </script>
@@ -13,5 +13,5 @@
13
13
 
14
14
  <div class="vstack w-full max-w-sm gap-2">
15
15
  <ChipInput bind:tags />
16
- <p class="text-xs text-[var(--sveltely-secondary-color)]">Tags: {tags.join(', ')}</p>
16
+ <p class="text-xs text-[var(--sveltely-text-secondary-color)]">Tags: {tags.join(', ')}</p>
17
17
  </div>