@mario_hahn/jumpy-ui 0.15.1 → 0.15.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.
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  JumpField,
3
3
  JumpyFieldContext
4
- } from "./chunk-UT6U2IMA.js";
4
+ } from "./chunk-ONQSFWRA.js";
5
5
  import {
6
6
  JumpySpacing,
7
7
  spacingValue,
8
8
  useJumpyTheme
9
- } from "./chunk-5YSWJIM2.js";
9
+ } from "./chunk-YWENJWF3.js";
10
10
 
11
11
  // editor.js
12
12
  import { useContext, useRef as useRef2, useState as useState2 } from "react";
@@ -18,7 +18,7 @@ import {
18
18
  textStyleValue,
19
19
  themeToCSSVariables,
20
20
  useJumpyTheme
21
- } from "./chunk-5YSWJIM2.js";
21
+ } from "./chunk-YWENJWF3.js";
22
22
  import {
23
23
  cn
24
24
  } from "./chunk-3DBKYKP2.js";
@@ -2722,7 +2722,7 @@ function JumpCheckbox({ label, children, checked, defaultChecked = false, indete
2722
2722
  }
2723
2723
  );
2724
2724
  }
2725
- function JumpSwitch({ label, children, checked, defaultChecked = false, onCheckedChange, labelPlacement = "end", innerClasses = {}, className = "", disabled = false, readOnly = false, style, ...props }) {
2725
+ function JumpSwitch({ label, children, checked, defaultChecked = false, onCheckedChange, labelPlacement = "end", variant = "inline", innerClasses = {}, className = "", disabled = false, readOnly = false, style, ...props }) {
2726
2726
  const theme = useJumpyTheme();
2727
2727
  const bodyMedium = textStyleValue(theme, JumpyTextStyle.bodyMedium);
2728
2728
  const [uncontrolledChecked, setUncontrolledChecked] = useState(Boolean(defaultChecked));
@@ -2732,6 +2732,7 @@ function JumpSwitch({ label, children, checked, defaultChecked = false, onChecke
2732
2732
  const selectorState = disabled ? "disabled" : isReadonly ? "readOnly" : "default";
2733
2733
  const selectorTokens = isChecked ? theme.selectors.active[selectorState] : theme.selectors.inactive[selectorState];
2734
2734
  const labelContent = children ?? label;
2735
+ const fieldRow = variant === "field";
2735
2736
  return /* @__PURE__ */ jsxs(
2736
2737
  "label",
2737
2738
  {
@@ -2739,7 +2740,8 @@ function JumpSwitch({ label, children, checked, defaultChecked = false, onChecke
2739
2740
  "data-checked": isChecked ? "true" : "false",
2740
2741
  "data-disabled": disabled ? "true" : void 0,
2741
2742
  "data-readonly": isReadonly ? "true" : void 0,
2742
- "data-label-placement": labelPlacement,
2743
+ "data-label-placement": fieldRow ? "start" : labelPlacement,
2744
+ "data-variant": variant,
2743
2745
  className: cn(className),
2744
2746
  style: {
2745
2747
  "--jumpy-cmp-switch-thumb-size": `${sizeValue(theme, JumpySize.small2XS)}px`,
@@ -2761,6 +2763,7 @@ function JumpSwitch({ label, children, checked, defaultChecked = false, onChecke
2761
2763
  fontSize: bodyMedium.fontSize,
2762
2764
  lineHeight: bodyMedium.lineHeight,
2763
2765
  fontWeight: bodyMedium.fontWeight,
2766
+ ...fieldRow ? { ...getFieldShellStyles(theme, disabled, "regular", false, readOnly), justifyContent: "space-between", paddingRight: spacingValue(theme, JumpySpacing.large), cursor: disabled || readOnly ? "default" : "pointer", "--jumpy-cmp-switch-label-color": "var(--jumpy-color-text-primary)" } : {},
2764
2767
  ...style || {}
2765
2768
  },
2766
2769
  children: [
@@ -15690,6 +15690,20 @@ var providerStyles = `
15690
15690
  isolation: isolate;
15691
15691
  }
15692
15692
 
15693
+ [data-jumpy-theme='true'] [data-jumpy-component='switch'][data-variant='field'] {
15694
+ --jumpy-cmp-base-input-border-color: var(--jumpy-input-regular-default-border);
15695
+ --jumpy-cmp-base-input-surface-color: var(--jumpy-input-regular-default-surface);
15696
+ }
15697
+
15698
+ [data-jumpy-theme='true'] [data-jumpy-component='switch'][data-variant='field']:hover:not([data-disabled='true']):not([data-readonly='true']) {
15699
+ --jumpy-cmp-base-input-border-color: var(--jumpy-input-regular-hover-border);
15700
+ --jumpy-cmp-base-input-surface-color: var(--jumpy-input-regular-hover-surface);
15701
+ }
15702
+
15703
+ [data-jumpy-theme='true'] [data-jumpy-component='switch'][data-variant='field']:has([data-jumpy-slot='switch-input']:focus-visible) {
15704
+ --jumpy-cmp-base-input-border-color: var(--jumpy-input-regular-focus-border);
15705
+ }
15706
+
15693
15707
  [data-jumpy-theme='true'] [data-jumpy-component='switch'][data-label-placement='start'] {
15694
15708
  flex-direction: row-reverse;
15695
15709
  }
@@ -74,7 +74,7 @@ import {
74
74
  getSortOrder,
75
75
  isRowFullySelected,
76
76
  useJumpSnackbar
77
- } from "./chunk-UT6U2IMA.js";
77
+ } from "./chunk-ONQSFWRA.js";
78
78
  import {
79
79
  JumpyAnimation,
80
80
  JumpyAnimationDelay,
@@ -105,7 +105,7 @@ import {
105
105
  textStyleValue,
106
106
  themeToCSSVariables,
107
107
  useJumpyTheme
108
- } from "./chunk-5YSWJIM2.js";
108
+ } from "./chunk-YWENJWF3.js";
109
109
  import "./chunk-3DBKYKP2.js";
110
110
  import {
111
111
  jumpyThemeInventory
package/dist/editor.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  JumpTokenInput
4
- } from "./chunk-ZFRDQCPV.js";
5
- import "./chunk-UT6U2IMA.js";
6
- import "./chunk-5YSWJIM2.js";
4
+ } from "./chunk-CEG6MK6U.js";
5
+ import "./chunk-ONQSFWRA.js";
6
+ import "./chunk-YWENJWF3.js";
7
7
  import "./chunk-3DBKYKP2.js";
8
8
  import "./chunk-XDTVYUWG.js";
9
9
  export {
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  JumpTokenInput
4
- } from "./chunk-ZFRDQCPV.js";
4
+ } from "./chunk-CEG6MK6U.js";
5
5
  import {
6
6
  BrandMark,
7
7
  JumpAppShell,
@@ -77,7 +77,7 @@ import {
77
77
  getSortOrder,
78
78
  isRowFullySelected,
79
79
  useJumpSnackbar
80
- } from "./chunk-UT6U2IMA.js";
80
+ } from "./chunk-ONQSFWRA.js";
81
81
  import {
82
82
  JumpyAnimation,
83
83
  JumpyAnimationDelay,
@@ -108,7 +108,7 @@ import {
108
108
  textStyleValue,
109
109
  themeToCSSVariables,
110
110
  useJumpyTheme
111
- } from "./chunk-5YSWJIM2.js";
111
+ } from "./chunk-YWENJWF3.js";
112
112
  import "./chunk-3DBKYKP2.js";
113
113
  import {
114
114
  jumpyThemeInventory
package/dist/theme.js CHANGED
@@ -30,7 +30,7 @@ import {
30
30
  textStyleValue,
31
31
  themeToCSSVariables,
32
32
  useJumpyTheme
33
- } from "./chunk-5YSWJIM2.js";
33
+ } from "./chunk-YWENJWF3.js";
34
34
  export {
35
35
  JumpyAnimation,
36
36
  JumpyAnimationDelay,
package/index.d.ts CHANGED
@@ -127,7 +127,7 @@ export declare function JumpSectionFooter(props: HTMLAttributes<HTMLElement> & {
127
127
  export declare function JumpTag(props: HTMLAttributes<HTMLSpanElement> & { size?: 'small' | 'medium'; status?: 'regular' | 'positive' | 'warning' | 'alarm'; disabled?: boolean; children: ReactNode }): ReactNode
128
128
  export declare function JumpChip(props: ButtonHTMLAttributes<HTMLButtonElement> & { selected?: boolean; disabled?: boolean; children: ReactNode }): ReactNode
129
129
  export declare function JumpCheckbox(props: Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'type' | 'children'> & { label?: ReactNode; children?: ReactNode; checked?: boolean; defaultChecked?: boolean; indeterminate?: boolean; onCheckedChange?: (checked: boolean) => void; onIndeterminateChange?: (indeterminate: boolean) => void; disabled?: boolean; readOnly?: boolean; labelPlacement?: 'start' | 'end'; innerClasses?: Partial<Record<'container' | 'input' | 'icons', { className?: string; style?: import('react').CSSProperties }>> }): ReactNode
130
- export declare function JumpSwitch(props: Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'type' | 'role' | 'children'> & { label?: ReactNode; children?: ReactNode; checked?: boolean; defaultChecked?: boolean; onChange?: (event: unknown) => void; onCheckedChange?: (checked: boolean) => void; disabled?: boolean; readOnly?: boolean; labelPlacement?: 'start' | 'end'; innerClasses?: JumpSwitchInnerClasses }): ReactNode
130
+ export declare function JumpSwitch(props: Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'type' | 'role' | 'children'> & { label?: ReactNode; children?: ReactNode; checked?: boolean; defaultChecked?: boolean; onChange?: (event: unknown) => void; onCheckedChange?: (checked: boolean) => void; disabled?: boolean; readOnly?: boolean; labelPlacement?: 'start' | 'end'; variant?: 'inline' | 'field'; innerClasses?: JumpSwitchInnerClasses }): ReactNode
131
131
  export declare function JumpRadioGroup(props: HTMLAttributes<HTMLDivElement> & { name?: string; value?: string; defaultValue?: string; onValueChange?: (value: string) => void; disabled?: boolean; readOnly?: boolean; direction?: 'horizontal' | 'vertical'; innerClasses?: JumpRadioInnerClasses; options: Array<{ value: string; label: ReactNode; disabled?: boolean }> }): ReactNode
132
132
  export type JumpDropdownItemValue = string | number
133
133
  export interface JumpDropdownItem<TValue extends JumpDropdownItemValue = JumpDropdownItemValue> { label: string; value: TValue; children?: Array<JumpDropdownItem<TValue>>; metadata?: Record<string, unknown>; disabled?: boolean }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mario_hahn/jumpy-ui",
3
- "version": "0.15.1",
3
+ "version": "0.15.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": ["**/*.css"],