@zuzjs/ui 0.10.0 → 0.10.1

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.
@@ -2,5 +2,6 @@ import { BoxProps } from "../Box";
2
2
  declare const Group: import("react").ForwardRefExoticComponent<BoxProps & {
3
3
  fxDelay?: number;
4
4
  fxStep?: number;
5
+ classToIgnore?: string;
5
6
  } & import("react").RefAttributes<HTMLDivElement>>;
6
7
  export default Group;
@@ -4,12 +4,18 @@ import { useDelayed } from "../..";
4
4
  import { addPropsToChildren } from "../../funs";
5
5
  import Box from "../Box";
6
6
  const Group = forwardRef((props, ref) => {
7
- const { children, fx, fxDelay, fxStep, ...rest } = props;
7
+ const { children, fx, fxDelay, fxStep, classToIgnore, ...rest } = props;
8
8
  const when = useDelayed();
9
9
  const Children = useMemo(() => {
10
10
  if (!fx)
11
11
  return children;
12
- return addPropsToChildren(children, child => !(`fx` in (child.props ?? {})), index => ({ fx: {
12
+ return addPropsToChildren(children, child => {
13
+ const props = child.props || {};
14
+ const hasFxProp = 'fx' in props;
15
+ const className = props.as ? Array.isArray(props.as) ? props.as.join(` `) : props.as : props.className || '';
16
+ const hasIgnoreClass = typeof className === 'string' && className.includes(classToIgnore || `--ignore`);
17
+ return !hasFxProp && !hasIgnoreClass;
18
+ }, index => ({ fx: {
13
19
  ...fx,
14
20
  delay: (fxDelay || 0) + index * (fxStep || .1), // how to increment per index ?
15
21
  when
@@ -2,5 +2,6 @@ import { BoxProps } from "../Box";
2
2
  declare const Group: import("react").ForwardRefExoticComponent<BoxProps & {
3
3
  fxDelay?: number;
4
4
  fxStep?: number;
5
+ classToIgnore?: string;
5
6
  } & import("react").RefAttributes<HTMLDivElement>>;
6
7
  export default Group;
@@ -4,12 +4,18 @@ import { useDelayed } from "../..";
4
4
  import { addPropsToChildren } from "../../funs";
5
5
  import Box from "../Box";
6
6
  const Group = forwardRef((props, ref) => {
7
- const { children, fx, fxDelay, fxStep, ...rest } = props;
7
+ const { children, fx, fxDelay, fxStep, classToIgnore, ...rest } = props;
8
8
  const when = useDelayed();
9
9
  const Children = useMemo(() => {
10
10
  if (!fx)
11
11
  return children;
12
- return addPropsToChildren(children, child => !(`fx` in (child.props ?? {})), index => ({ fx: {
12
+ return addPropsToChildren(children, child => {
13
+ const props = child.props || {};
14
+ const hasFxProp = 'fx' in props;
15
+ const className = props.as ? Array.isArray(props.as) ? props.as.join(` `) : props.as : props.className || '';
16
+ const hasIgnoreClass = typeof className === 'string' && className.includes(classToIgnore || `--ignore`);
17
+ return !hasFxProp && !hasIgnoreClass;
18
+ }, index => ({ fx: {
13
19
  ...fx,
14
20
  delay: (fxDelay || 0) + index * (fxStep || .1), // how to increment per index ?
15
21
  when