@proto.ui/prototypes-shadcn 0.2.0-rc.3 → 0.2.0-rc.5

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.
@@ -10,8 +10,7 @@ const ROOT_BASE_TOKENS = [
10
10
  'rounded-full',
11
11
  'border',
12
12
  'border-transparent',
13
- 'pl-0.5',
14
- 'pr-5',
13
+ 'px-0.5',
15
14
  'shadow-xs',
16
15
  'transition-all',
17
16
  'duration-200',
@@ -35,7 +34,7 @@ const switchRoot = definePrototype({
35
34
  // P-SHADCN-SWITCH-STATE-DRIVEN-STYLES
36
35
  def.rule({
37
36
  when: (w) => w.state(checked).eq(true),
38
- intent: (i) => i.feedback.style.use(tw('pl-5 pr-0.5 bg-primary text-primary-foreground')),
37
+ intent: (i) => i.feedback.style.use(tw('bg-primary text-primary-foreground')),
39
38
  });
40
39
  def.rule({
41
40
  when: (w) => w.all(w.state(checked).eq(false), w.state(hovered).eq(true)),
@@ -22,9 +22,17 @@ const switchThumb = definePrototype({
22
22
  // P-SHADCN-SWITCH-THUMB-BASE-INHERITANCE,
23
23
  // P-SHADCN-SWITCH-THUMB-CURRENT-BASE-DEVIATIONS,
24
24
  // P-SHADCN-SWITCH-THUMB-CONTEXT-INDICATOR
25
- asSwitchThumb();
25
+ const switchState = asSwitchThumb().stateHandles;
26
+ if (!switchState) {
27
+ throw new Error('[shadcn-switch-thumb] asSwitchThumb must project Switch thumb state handles.');
28
+ }
29
+ const { checked } = switchState;
26
30
  // P-SHADCN-SWITCH-THUMB-CURRENT-VISUAL-SURFACE
27
31
  def.feedback.style.use(tw(THUMB_TOKENS));
32
+ def.rule({
33
+ when: (w) => w.state(checked).eq(true),
34
+ intent: (i) => i.feedback.style.use(tw('translate-x-5')),
35
+ });
28
36
  },
29
37
  });
30
38
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proto.ui/prototypes-shadcn",
3
- "version": "0.2.0-rc.3",
3
+ "version": "0.2.0-rc.5",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "protoUi": {
@@ -11,8 +11,8 @@
11
11
  }
12
12
  },
13
13
  "dependencies": {
14
- "@proto.ui/core": "0.2.0-rc.3",
15
- "@proto.ui/prototypes-base": "0.2.0-rc.3"
14
+ "@proto.ui/core": "0.2.0-rc.5",
15
+ "@proto.ui/prototypes-base": "0.2.0-rc.5"
16
16
  },
17
17
  "exports": {
18
18
  ".": {