@newtonedev/editor 0.1.1 → 0.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newtonedev/editor",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Shared color system editor for Newtone applications",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,6 +1,6 @@
1
- import { Slider, useTokens } from "@newtonedev/components";
1
+ import { Slider, Select, useTokens } from "@newtonedev/components";
2
2
  import { srgbToHex } from "newtone";
3
- import type { ConfiguratorState } from "@newtonedev/configurator";
3
+ import type { ConfiguratorState, SpacingPreset } from "@newtonedev/configurator";
4
4
  import type { ConfiguratorAction } from "@newtonedev/configurator";
5
5
 
6
6
  interface OthersSectionProps {
@@ -11,9 +11,17 @@ interface OthersSectionProps {
11
11
  export function OthersSection({ state, dispatch }: OthersSectionProps) {
12
12
  const tokens = useTokens();
13
13
 
14
- const density = state.spacing?.density ?? 0.5;
14
+ const spacingPreset = state.spacing?.preset ?? 'md';
15
15
  const intensity = state.roundness?.intensity ?? 0.5;
16
16
 
17
+ const spacingOptions: Array<{ value: SpacingPreset; label: string }> = [
18
+ { value: 'xs', label: 'Extra Small' },
19
+ { value: 'sm', label: 'Small' },
20
+ { value: 'md', label: 'Medium' },
21
+ { value: 'lg', label: 'Large' },
22
+ { value: 'xl', label: 'Extra Large' },
23
+ ];
24
+
17
25
  return (
18
26
  <div style={{ display: "flex", flexDirection: "column", gap: 16 }}>
19
27
  <div>
@@ -29,15 +37,13 @@ export function OthersSection({ state, dispatch }: OthersSectionProps) {
29
37
  >
30
38
  Spacing
31
39
  </div>
32
- <Slider
33
- value={Math.round(density * 100)}
34
- onValueChange={(v) =>
35
- dispatch({ type: "SET_SPACING_DENSITY", density: v / 100 })
40
+ <Select
41
+ value={spacingPreset}
42
+ onValueChange={(preset) =>
43
+ dispatch({ type: "SET_SPACING_PRESET", preset: preset as SpacingPreset })
36
44
  }
37
- min={0}
38
- max={100}
39
- label="Density"
40
- showValue
45
+ options={spacingOptions}
46
+ label="Preset"
41
47
  />
42
48
  </div>
43
49