@intechstudio/grid-uikit 1.20260922.1001 → 1.20260922.1144

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.
@@ -93,7 +93,7 @@
93
93
  flex-direction: column;
94
94
  align-items: flex-start;
95
95
  border: 1px solid var(--foreground-muted);
96
- border-radius: var(--radius-large);
96
+ border-radius: var(--radius-medium);
97
97
  position: absolute;
98
98
  z-index: 40;
99
99
  color: var(--foreground-muted);
@@ -112,7 +112,7 @@
112
112
  display: flex;
113
113
  align-items: center;
114
114
  justify-content: center;
115
- border-radius: var(--radius);
115
+ border-radius: var(--radius-medium);
116
116
  cursor: pointer;
117
117
  pointer-events: auto;
118
118
  padding: 0.5rem;
@@ -375,7 +375,7 @@
375
375
  background-color: var(--popover-background);
376
376
  color: var(--foreground-muted);
377
377
  border: 1px solid var(--foreground-muted);
378
- border-radius: var(--radius-large);
378
+ border-radius: var(--radius-medium);
379
379
  z-index: 40;
380
380
  max-height: 8em;
381
381
  display: flex;
@@ -133,7 +133,7 @@
133
133
  background-color: var(--popover-background);
134
134
  color: var(--foreground-muted);
135
135
  border: 1px solid var(--foreground-muted);
136
- border-radius: var(--radius-large);
136
+ border-radius: var(--radius-medium);
137
137
  z-index: 40;
138
138
  overflow: hidden;
139
139
  }
@@ -10,6 +10,13 @@
10
10
  export let max: number;
11
11
  export let step: number;
12
12
  export let disabled = false;
13
+ // Optional custom track background (e.g. a color gradient). When set, the
14
+ // track shows this background and the selected-range fill is hidden so the
15
+ // full background stays visible.
16
+ export let trackBackground: string | undefined = undefined;
17
+ // Optional custom thumb background (e.g. the color at the thumb's value on a
18
+ // color slider). When unset the thumb uses the default theme color.
19
+ export let thumbBackground: string | undefined = undefined;
13
20
 
14
21
  const {
15
22
  elements: { root, range, thumbs },
@@ -55,8 +62,19 @@
55
62
  </script>
56
63
 
57
64
  <span {...$root} use:root class="container" class:disabled>
58
- <span class="range-full" class:disabled>
59
- <span {...$range} use:range class="range-selected" class:disabled />
65
+ <span
66
+ class="range-full"
67
+ class:disabled
68
+ class:has-background={trackBackground}
69
+ style:background={trackBackground}
70
+ >
71
+ <span
72
+ {...$range}
73
+ use:range
74
+ class="range-selected"
75
+ class:disabled
76
+ class:hidden={trackBackground}
77
+ />
60
78
  </span>
61
79
  <!-- svelte-ignore a11y-no-static-element-interactions -->
62
80
  <span
@@ -64,6 +82,8 @@
64
82
  use:thumbs
65
83
  class="thumb"
66
84
  class:disabled
85
+ class:has-color={thumbBackground}
86
+ style:background={disabled ? undefined : thumbBackground}
67
87
  on:blur={handleThumbBlur}
68
88
  />
69
89
  </span>
@@ -91,11 +111,17 @@
91
111
  height: 8px;
92
112
  border-radius: var(--radius);
93
113
  }
114
+ span.range-full.has-background {
115
+ background-color: transparent;
116
+ }
94
117
  span.range-selected {
95
118
  height: 8px;
96
119
  background-color: var(--foreground-disabled);
97
120
  border-radius: var(--radius);
98
121
  }
122
+ span.range-selected.hidden {
123
+ background-color: transparent;
124
+ }
99
125
  span.thumb {
100
126
  display: block;
101
127
  height: var(--thumb-size);
@@ -103,6 +129,10 @@
103
129
  background-color: var(--foreground-muted);
104
130
  border-radius: var(--radius);
105
131
  }
132
+ span.thumb.has-color {
133
+ width: var(--thumb-size);
134
+ border-radius: var(--radius-full);
135
+ }
106
136
  span.thumb:focus {
107
137
  outline: var(--focus-outline);
108
138
  outline-offset: var(--focus-offset);
@@ -17,6 +17,8 @@ declare const MeltSlider: $$__sveltets_2_IsomorphicComponent<{
17
17
  max: number;
18
18
  step: number;
19
19
  disabled?: boolean;
20
+ trackBackground?: string | undefined;
21
+ thumbBackground?: string | undefined;
20
22
  }, {
21
23
  change: CustomEvent<any>;
22
24
  blur: CustomEvent<any>;
@@ -206,7 +206,7 @@
206
206
  background-color: var(--popover-background);
207
207
  color: var(--foreground-muted);
208
208
  border: 1px solid var(--foreground-muted);
209
- border-radius: var(--radius-large);
209
+ border-radius: var(--radius-medium);
210
210
  overflow: hidden;
211
211
  }
212
212
 
@@ -355,7 +355,7 @@
355
355
  display: flex;
356
356
  flex-direction: column;
357
357
  position: relative;
358
- border-radius: var(--radius-large);
358
+ border-radius: var(--radius-medium);
359
359
  overflow: hidden;
360
360
  z-index: 99;
361
361
  padding: 0.5rem;
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
2
  import { createEventDispatcher } from "svelte";
3
3
  import { Color } from "./color";
4
- import ColorSlider from "./ColorSlider.svelte";
4
+ import MeltSlider from "./MeltSlider.svelte";
5
5
 
6
6
  function getRandom(a: number, b: number) {
7
7
  return 0;
@@ -42,37 +42,38 @@
42
42
  dispatch("change", { color: color });
43
43
  }
44
44
 
45
- function getGradient(color: Color.HSL | undefined, channel: Channel) {
45
+ function getGradient(
46
+ color: Color.HSL | undefined,
47
+ channel: Channel,
48
+ ): string | undefined {
46
49
  if (typeof color === "undefined") {
47
- return "background-color: white;";
50
+ return undefined;
48
51
  }
49
52
 
50
53
  const stops = {
51
- h: [0, 60, 120, 180, 240, 360].map((h) =>
54
+ h: [0, 60, 120, 180, 240, 300, 360].map((h) =>
52
55
  new Color.HSL(h, color.s, color.l).toHEX(),
53
56
  ),
54
57
  s: [0, 100].map((s) => new Color.HSL(color.h, s, color.l).toHEX()),
55
58
  l: [0, 50, 100].map((l) => new Color.HSL(color.h, color.s, l).toHEX()),
56
59
  };
57
- return `background: linear-gradient(to right, ${stops[channel].join(
58
- ", ",
59
- )});`;
60
+ return `linear-gradient(to right, ${stops[channel].join(", ")})`;
60
61
  }
61
62
  </script>
62
63
 
63
64
  <div class="slider-grid">
64
65
  {#each sliders as { label, key, max }}
65
66
  <span class="slider-label">{label}:</span>
66
- <ColorSlider
67
- value={color ? color[key] : undefined}
67
+ <MeltSlider
68
+ target={color ? color[key] : 0}
69
+ min={0}
68
70
  {max}
69
- direction="horizontal"
70
- round={true}
71
- on:input={(e) => handleInput(key, e.detail.value)}
72
- on:change={handleChange}
73
- >
74
- <div class="slider-gradient" style={getGradient(color, key)} />
75
- </ColorSlider>
71
+ step={1}
72
+ trackBackground={getGradient(color, key)}
73
+ thumbBackground={color ? color.toHEX() : undefined}
74
+ on:change={(e) => handleInput(key, e.detail.value)}
75
+ on:commit={handleChange}
76
+ />
76
77
  {/each}
77
78
  </div>
78
79
 
@@ -86,12 +87,7 @@
86
87
  }
87
88
 
88
89
  .slider-label {
89
- color: white;
90
+ color: var(--foreground);
90
91
  font-size: 0.875rem;
91
92
  }
92
-
93
- .slider-gradient {
94
- width: 100%;
95
- height: 100%;
96
- }
97
93
  </style>
package/dist/theme.css CHANGED
@@ -49,6 +49,9 @@
49
49
  --radius-small: min(var(--radius), 0.25em);
50
50
  --radius-medium: min(var(--radius), 0.5em);
51
51
  --radius-large: min(var(--radius), 1em);
52
+ /* Always fully rounded (pill/circle), independent of --radius — for elements
53
+ that are round by design, e.g. the color-preview slider knob. */
54
+ --radius-full: 9999px;
52
55
  --border-thickness: 1px;
53
56
  }
54
57
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intechstudio/grid-uikit",
3
- "version": "1.20260922.1001",
3
+ "version": "1.20260922.1144",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/intechstudio/grid-uikit.git"
package/src/lib/theme.css CHANGED
@@ -49,6 +49,9 @@
49
49
  --radius-small: min(var(--radius), 0.25em);
50
50
  --radius-medium: min(var(--radius), 0.5em);
51
51
  --radius-large: min(var(--radius), 1em);
52
+ /* Always fully rounded (pill/circle), independent of --radius — for elements
53
+ that are round by design, e.g. the color-preview slider knob. */
54
+ --radius-full: 9999px;
52
55
  --border-thickness: 1px;
53
56
  }
54
57