@tableslayer/ui 0.1.18 → 0.1.21

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.
@@ -4,13 +4,29 @@
4
4
  interface Props {
5
5
  brushSize: number;
6
6
  onBrushSizeChange: (value: number) => void;
7
+ gridSpacing?: number;
8
+ displayWidth?: number;
7
9
  }
8
10
 
9
- let { brushSize, onBrushSizeChange }: Props = $props();
11
+ let { brushSize, onBrushSizeChange, gridSpacing, displayWidth }: Props = $props();
12
+
13
+ const minBrushSize = $derived.by(() => {
14
+ if (gridSpacing && displayWidth && displayWidth > 0) {
15
+ return Math.max(0.5, (gridSpacing / displayWidth) * 100);
16
+ }
17
+ return 2;
18
+ });
10
19
  </script>
11
20
 
12
21
  <div class="fogSliders">
13
- <BrushSizeSlider {brushSize} {onBrushSizeChange} min={5} max={20} curve="linear" displayAsPercentage={true} />
22
+ <BrushSizeSlider
23
+ {brushSize}
24
+ {onBrushSizeChange}
25
+ min={minBrushSize}
26
+ max={20}
27
+ curve="linear"
28
+ displayAsPercentage={true}
29
+ />
14
30
  </div>
15
31
 
16
32
  <style>
@@ -1,6 +1,8 @@
1
1
  interface Props {
2
2
  brushSize: number;
3
3
  onBrushSizeChange: (value: number) => void;
4
+ gridSpacing?: number;
5
+ displayWidth?: number;
4
6
  }
5
7
  declare const FogSliders: import("svelte").Component<Props, {}, "">;
6
8
  type FogSliders = ReturnType<typeof FogSliders>;
@@ -0,0 +1,44 @@
1
+ <script lang="ts">
2
+ import IconWrapper from '../Icon/Icon.svelte';
3
+
4
+ type Props = {
5
+ text: string;
6
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
+ icon?: any;
8
+ };
9
+
10
+ let { text, icon }: Props = $props();
11
+ </script>
12
+
13
+ <span class="textHighlight">
14
+ {#if icon}
15
+ <IconWrapper Icon={icon} size="0.875em" class="textHighlight__icon" />
16
+ {/if}
17
+ <span class="textHighlight__text">{text}</span>
18
+ </span>
19
+
20
+ <style>
21
+ .textHighlight {
22
+ display: inline-flex;
23
+ align-items: center;
24
+ gap: 0.25em;
25
+ font-family: var(--font-mono);
26
+ font-size: 0.95em;
27
+ padding: 0.1em 0.35em;
28
+ color: var(--fg);
29
+ background-color: var(--contrastLowest);
30
+ border: var(--borderThin);
31
+ border-color: var(--contrastEmpty);
32
+ border-radius: var(--radius-1);
33
+ vertical-align: baseline;
34
+ }
35
+
36
+ .textHighlight__text {
37
+ line-height: 1.2;
38
+ }
39
+
40
+ :global(.textHighlight__icon) {
41
+ color: var(--fg);
42
+ flex-shrink: 0;
43
+ }
44
+ </style>
@@ -0,0 +1,7 @@
1
+ type Props = {
2
+ text: string;
3
+ icon?: any;
4
+ };
5
+ declare const TextHighlight: import("svelte").Component<Props, {}, "">;
6
+ type TextHighlight = ReturnType<typeof TextHighlight>;
7
+ export default TextHighlight;
@@ -0,0 +1 @@
1
+ export { default as TextHighlight } from './TextHighlight.svelte';
@@ -0,0 +1 @@
1
+ export { default as TextHighlight } from './TextHighlight.svelte';
@@ -22,6 +22,7 @@ export * from './Select';
22
22
  export * from './Spacer';
23
23
  export * from './Table';
24
24
  export * from './Text';
25
+ export * from './TextHighlight';
25
26
  export * from './Title';
26
27
  export * from './Toast';
27
28
  export * from './ToolTip';
@@ -22,6 +22,7 @@ export * from './Select';
22
22
  export * from './Spacer';
23
23
  export * from './Table';
24
24
  export * from './Text';
25
+ export * from './TextHighlight';
25
26
  export * from './Title';
26
27
  export * from './Toast';
27
28
  export * from './ToolTip';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tableslayer/ui",
3
- "version": "0.1.18",
3
+ "version": "0.1.21",
4
4
  "license": "FSL-1.1-ALv2",
5
5
  "repository": {
6
6
  "type": "git",