ui-ingredients 0.0.14 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -60,7 +60,7 @@ npm install ui-ingredients
60
60
  - 🟢 RadioGroup
61
61
  - 🟢 RatingGroup
62
62
  - 🟢 Select
63
- - 🟡 SegmentGroup
63
+ - 🟢 SegmentGroup
64
64
  - ⚪ SignaturePad
65
65
  - 🟢 Slider
66
66
  - ⚪ Splitter
@@ -1,2 +1,3 @@
1
1
  import { anatomy } from '@zag-js/radio-group';
2
2
  export const segmentGroupAnatomy = anatomy.rename('segment-group');
3
+ export const parts = segmentGroupAnatomy.build();
@@ -1,30 +1,47 @@
1
1
  import * as segmentGroup from '@zag-js/radio-group';
2
- import { mergeProps, normalizeProps, reflect, useMachine } from '@zag-js/svelte';
2
+ import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
3
3
  import { getContext, setContext } from 'svelte';
4
- import { segmentGroupAnatomy } from './anatomy.js';
4
+ import { parts } from './anatomy.js';
5
5
  export function createSegmentGroupContext(props) {
6
- const parts = $derived(segmentGroupAnatomy.build());
7
6
  const [state, send] = useMachine(segmentGroup.machine(props));
8
7
  const api = $derived(segmentGroup.connect(state, send, normalizeProps));
9
8
  const modified = $derived(reflect(() => ({
10
9
  ...api,
11
10
  getIndicatorProps() {
12
- return mergeProps(api.getIndicatorProps(), parts.indicator.attrs);
11
+ return {
12
+ ...api.getIndicatorProps(),
13
+ ...parts.indicator.attrs,
14
+ };
13
15
  },
14
16
  getItemControlProps(props) {
15
- return mergeProps(api.getItemControlProps(props), parts.itemControl.attrs);
17
+ return {
18
+ ...api.getItemControlProps(props),
19
+ ...parts.itemControl.attrs,
20
+ };
16
21
  },
17
22
  getItemProps(props) {
18
- return mergeProps(api.getItemProps(props), parts.item.attrs);
23
+ return {
24
+ ...api.getItemProps(props),
25
+ ...parts.item.attrs,
26
+ };
19
27
  },
20
28
  getItemTextProps(props) {
21
- return mergeProps(api.getItemTextProps(props), parts.itemText.attrs);
29
+ return {
30
+ ...api.getItemTextProps(props),
31
+ ...parts.itemText.attrs,
32
+ };
22
33
  },
23
34
  getLabelProps() {
24
- return mergeProps(api.getLabelProps(), parts.label.attrs);
35
+ return {
36
+ ...api.getLabelProps(),
37
+ ...parts.label.attrs,
38
+ };
25
39
  },
26
40
  getRootProps() {
27
- return mergeProps(api.getRootProps(), parts.root.attrs);
41
+ return {
42
+ ...api.getRootProps(),
43
+ ...parts.root.attrs,
44
+ };
28
45
  },
29
46
  })));
30
47
  return modified;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ui-ingredients",
3
3
  "type": "module",
4
- "version": "0.0.14",
4
+ "version": "0.0.16",
5
5
  "packageManager": "pnpm@9.7.0",
6
6
  "svelte": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",