@pyreon/rocketstyle 0.11.5 → 0.11.6

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.
Files changed (51) hide show
  1. package/README.md +32 -32
  2. package/lib/index.d.ts +25 -6
  3. package/lib/index.js +99 -88
  4. package/package.json +25 -24
  5. package/src/__tests__/attrs.test.ts +49 -49
  6. package/src/__tests__/chaining.test.ts +27 -27
  7. package/src/__tests__/collection.test.ts +12 -12
  8. package/src/__tests__/compose.test.ts +10 -10
  9. package/src/__tests__/context.test.ts +65 -65
  10. package/src/__tests__/createLocalProvider.test.ts +53 -53
  11. package/src/__tests__/dimensions.test.ts +54 -54
  12. package/src/__tests__/e2e-styler.test.ts +78 -136
  13. package/src/__tests__/hooks.test.ts +41 -70
  14. package/src/__tests__/isRocketComponent.test.ts +11 -11
  15. package/src/__tests__/misc.test.ts +91 -91
  16. package/src/__tests__/providerConsumer.test.ts +54 -126
  17. package/src/__tests__/rocketstyleIntegration.test.ts +180 -253
  18. package/src/__tests__/themeUtils.test.ts +173 -173
  19. package/src/cache/index.ts +1 -1
  20. package/src/constants/booleanTags.ts +25 -25
  21. package/src/constants/defaultDimensions.ts +5 -5
  22. package/src/constants/index.ts +16 -16
  23. package/src/context/context.ts +13 -10
  24. package/src/context/createLocalProvider.ts +22 -12
  25. package/src/context/localContext.ts +2 -2
  26. package/src/hoc/index.ts +1 -1
  27. package/src/hoc/rocketstyleAttrsHoc.ts +26 -29
  28. package/src/hooks/index.ts +2 -2
  29. package/src/hooks/usePseudoState.ts +3 -3
  30. package/src/hooks/useTheme.ts +14 -17
  31. package/src/index.ts +32 -15
  32. package/src/init.ts +12 -12
  33. package/src/isRocketComponent.ts +2 -2
  34. package/src/rocketstyle.ts +103 -109
  35. package/src/types/attrs.ts +2 -2
  36. package/src/types/config.ts +4 -4
  37. package/src/types/configuration.ts +5 -5
  38. package/src/types/dimensions.ts +5 -5
  39. package/src/types/hoc.ts +1 -1
  40. package/src/types/rocketComponent.ts +4 -4
  41. package/src/types/rocketstyle.ts +10 -10
  42. package/src/types/styles.ts +9 -4
  43. package/src/types/theme.ts +4 -4
  44. package/src/types/utils.ts +1 -1
  45. package/src/utils/attrs.ts +2 -2
  46. package/src/utils/chaining.ts +2 -2
  47. package/src/utils/compose.ts +1 -1
  48. package/src/utils/dimensions.ts +6 -6
  49. package/src/utils/statics.ts +2 -2
  50. package/src/utils/styles.ts +2 -2
  51. package/src/utils/theme.ts +10 -10
@@ -4,29 +4,29 @@
4
4
  * out as unknown styling props.
5
5
  */
6
6
  export default [
7
- "allowFullScreen",
8
- "allowPaymentRequest",
9
- "async",
10
- "autoFocus",
11
- "autoPlay",
12
- "checked",
13
- "controls",
14
- "default",
15
- "defer",
16
- "disabled",
17
- "formNoValidate",
18
- "hidden",
19
- "isMap",
20
- "itemScope",
21
- "loop",
22
- "multiple",
23
- "muted",
24
- "noModule",
25
- "noValidate",
26
- "open",
27
- "readOnly",
28
- "required",
29
- "reversed",
30
- "selected",
31
- "typeMustMatch",
7
+ 'allowFullScreen',
8
+ 'allowPaymentRequest',
9
+ 'async',
10
+ 'autoFocus',
11
+ 'autoPlay',
12
+ 'checked',
13
+ 'controls',
14
+ 'default',
15
+ 'defer',
16
+ 'disabled',
17
+ 'formNoValidate',
18
+ 'hidden',
19
+ 'isMap',
20
+ 'itemScope',
21
+ 'loop',
22
+ 'multiple',
23
+ 'muted',
24
+ 'noModule',
25
+ 'noValidate',
26
+ 'open',
27
+ 'readOnly',
28
+ 'required',
29
+ 'reversed',
30
+ 'selected',
31
+ 'typeMustMatch',
32
32
  ]
@@ -4,15 +4,15 @@
4
4
  * and `multiple` (a multi-select dimension).
5
5
  */
6
6
  const DEFAULT_DIMENSIONS = {
7
- states: "state",
8
- sizes: "size",
9
- variants: "variant",
7
+ states: 'state',
8
+ sizes: 'size',
9
+ variants: 'variant',
10
10
  multiple: {
11
- propName: "multiple",
11
+ propName: 'multiple',
12
12
  multi: true,
13
13
  },
14
14
  modifiers: {
15
- propName: "modifier",
15
+ propName: 'modifier',
16
16
  multi: true,
17
17
  transform: true,
18
18
  },
@@ -1,11 +1,11 @@
1
1
  /** Default theme mode used when no mode is provided via context. */
2
- export const MODE_DEFAULT = "light"
2
+ export const MODE_DEFAULT = 'light'
3
3
 
4
4
  /** Pseudo-state interaction keys tracked for styling (hover, active, focus, pressed). */
5
- export const PSEUDO_KEYS = ["hover", "active", "focus", "pressed"] as const
5
+ export const PSEUDO_KEYS = ['hover', 'active', 'focus', 'pressed'] as const
6
6
 
7
7
  /** Meta pseudo-state keys representing non-interactive states (disabled, readOnly). */
8
- export const PSEUDO_META_KEYS = ["disabled", "readOnly"] as const
8
+ export const PSEUDO_META_KEYS = ['disabled', 'readOnly'] as const
9
9
 
10
10
  /** Supported theme mode flags. */
11
11
  export const THEME_MODES = {
@@ -15,30 +15,30 @@ export const THEME_MODES = {
15
15
 
16
16
  /** Maps each theme mode to its inverse (light -> dark, dark -> light). */
17
17
  export const THEME_MODES_INVERSED = {
18
- dark: "light",
19
- light: "dark",
18
+ dark: 'light',
19
+ light: 'dark',
20
20
  } as const
21
21
 
22
22
  /** Reserved configuration keys accepted by the `.config()` chaining method. */
23
23
  export const CONFIG_KEYS = [
24
- "provider",
25
- "consumer",
26
- "DEBUG",
27
- "name",
28
- "component",
29
- "inversed",
30
- "passProps",
31
- "styled",
24
+ 'provider',
25
+ 'consumer',
26
+ 'DEBUG',
27
+ 'name',
28
+ 'component',
29
+ 'inversed',
30
+ 'passProps',
31
+ 'styled',
32
32
  ] as const
33
33
 
34
34
  /** Keys for theme and styles chaining methods. */
35
- export const STYLING_KEYS = ["theme", "styles"] as const
36
- export const STATIC_KEYS = [...STYLING_KEYS, "compose"] as const
35
+ export const STYLING_KEYS = ['theme', 'styles'] as const
36
+ export const STATIC_KEYS = [...STYLING_KEYS, 'compose'] as const
37
37
 
38
38
  /** Union of all reserved keys that cannot be used as dimension names. */
39
39
  export const ALL_RESERVED_KEYS = [
40
40
  ...Object.keys(THEME_MODES),
41
41
  ...CONFIG_KEYS,
42
42
  ...STATIC_KEYS,
43
- "attrs",
43
+ 'attrs',
44
44
  ] as const
@@ -1,7 +1,7 @@
1
- import type { VNodeChild } from "@pyreon/core"
2
- import { useContext } from "@pyreon/core"
3
- import { Provider as CoreProvider, context } from "@pyreon/ui-core"
4
- import { MODE_DEFAULT, THEME_MODES_INVERSED } from "../constants"
1
+ import type { VNodeChild } from '@pyreon/core'
2
+ import { useContext } from '@pyreon/core'
3
+ import { Provider as CoreProvider, context } from '@pyreon/ui-core'
4
+ import { MODE_DEFAULT, THEME_MODES_INVERSED } from '../constants'
5
5
 
6
6
  type Theme = {
7
7
  rootSize: number
@@ -11,7 +11,7 @@ type Theme = {
11
11
  export type TProvider = {
12
12
  children: VNodeChild
13
13
  theme?: Theme | undefined
14
- mode?: "light" | "dark" | undefined
14
+ mode?: 'light' | 'dark' | undefined
15
15
  inversed?: boolean | undefined
16
16
  provider?: ((props: Record<string, unknown>) => VNodeChild) | undefined
17
17
  }
@@ -24,9 +24,11 @@ export type TProvider = {
24
24
  * In Pyreon, context is provided via provide() instead of React.Provider.
25
25
  */
26
26
  const Provider = ({ provider = CoreProvider, inversed, ...props }: TProvider): VNodeChild => {
27
- const ctx = useContext<TProvider>(context)
27
+ const getCtx = useContext(context)
28
+ const ctx = getCtx()
28
29
 
29
- const { theme, mode, provider: RocketstyleProvider, children } = { ...ctx, ...props, provider }
30
+ const merged = { ...ctx, ...props, provider } as unknown as TProvider & Record<string, unknown>
31
+ const { theme, mode, provider: RocketstyleProvider, children } = merged
30
32
 
31
33
  let newMode = MODE_DEFAULT
32
34
 
@@ -34,10 +36,11 @@ const Provider = ({ provider = CoreProvider, inversed, ...props }: TProvider): V
34
36
  newMode = inversed ? THEME_MODES_INVERSED[mode] : mode
35
37
  }
36
38
 
37
- const result = RocketstyleProvider({
39
+ const FinalProvider = RocketstyleProvider ?? CoreProvider
40
+ const result = FinalProvider({
38
41
  mode: newMode,
39
- isDark: newMode === "dark",
40
- isLight: newMode === "light",
42
+ isDark: newMode === 'dark',
43
+ isLight: newMode === 'light',
41
44
  ...(theme !== undefined ? { theme } : {}),
42
45
  provider,
43
46
  children,
@@ -1,8 +1,8 @@
1
- import { provide } from "@pyreon/core"
2
- import { signal } from "@pyreon/reactivity"
3
- import type { PseudoProps } from "../types/pseudo"
4
- import type { ComponentFn } from "../types/utils"
5
- import { localContext } from "./localContext"
1
+ import { provide } from '@pyreon/core'
2
+ import { signal } from '@pyreon/reactivity'
3
+ import type { PseudoProps } from '../types/pseudo'
4
+ import type { ComponentFn } from '../types/utils'
5
+ import { localContext } from './localContext'
6
6
 
7
7
  type Props = PseudoProps & Record<string, any>
8
8
 
@@ -29,12 +29,6 @@ const createLocalProvider = (WrappedComponent: ComponentFn<any>) => {
29
29
  const focus = signal(false)
30
30
  const pressed = signal(false)
31
31
 
32
- const pseudoState = () => ({
33
- hover: hover(),
34
- focus: focus(),
35
- pressed: pressed(),
36
- })
37
-
38
32
  const events = {
39
33
  onMouseEnter: (e: MouseEvent) => {
40
34
  hover.set(true)
@@ -63,9 +57,25 @@ const createLocalProvider = (WrappedComponent: ComponentFn<any>) => {
63
57
  },
64
58
  }
65
59
 
60
+ // Use getters so pseudo-state signals are read lazily by consumers
61
+ // inside their own reactive scopes — NOT eagerly during parent setup.
62
+ // Without getters, hover()/focus()/pressed() reads here would register
63
+ // as dependencies of any parent effect, causing cascading re-renders
64
+ // on every mouse event.
66
65
  const updatedState = {
67
66
  ...$rocketstate,
68
- pseudo: { ...$rocketstate?.pseudo, ...pseudoState() },
67
+ pseudo: {
68
+ ...$rocketstate?.pseudo,
69
+ get hover() {
70
+ return hover()
71
+ },
72
+ get focus() {
73
+ return focus()
74
+ },
75
+ get pressed() {
76
+ return pressed()
77
+ },
78
+ },
69
79
  }
70
80
 
71
81
  // Provide local context for child rocketstyle components
@@ -1,5 +1,5 @@
1
- import { createContext, useContext } from "@pyreon/core"
2
- import type { PseudoState } from "../types/pseudo"
1
+ import { createContext, useContext } from '@pyreon/core'
2
+ import type { PseudoState } from '../types/pseudo'
3
3
 
4
4
  type LocalContext = Partial<
5
5
  {
package/src/hoc/index.ts CHANGED
@@ -1,3 +1,3 @@
1
- import rocketstyleAttrsHoc from "./rocketstyleAttrsHoc"
1
+ import rocketstyleAttrsHoc from './rocketstyleAttrsHoc'
2
2
 
3
3
  export { rocketstyleAttrsHoc }
@@ -1,14 +1,14 @@
1
- import { render } from "@pyreon/ui-core"
2
- import { useTheme } from "../hooks"
3
- import type { Configuration } from "../types/configuration"
4
- import type { ComponentFn } from "../types/utils"
5
- import { calculateChainOptions, removeUndefinedProps } from "../utils/attrs"
1
+ import { render } from '@pyreon/ui-core'
2
+ import { useTheme } from '../hooks'
3
+ import type { Configuration } from '../types/configuration'
4
+ import type { ComponentFn } from '../types/utils'
5
+ import { calculateChainOptions, removeUndefinedProps } from '../utils/attrs'
6
6
 
7
7
  export type RocketStyleHOC = ({
8
8
  inversed,
9
9
  attrs,
10
10
  priorityAttrs,
11
- }: Pick<Configuration, "inversed" | "attrs" | "priorityAttrs">) => (
11
+ }: Pick<Configuration, 'inversed' | 'attrs' | 'priorityAttrs'>) => (
12
12
  WrappedComponent: ComponentFn<any>,
13
13
  ) => ComponentFn<any>
14
14
 
@@ -35,34 +35,31 @@ const rocketStyleHOC: RocketStyleHOC = ({ inversed, attrs, priorityAttrs }) => {
35
35
  // Remove undefined props not to override potential default props
36
36
  const filteredProps = removeUndefinedProps(props)
37
37
 
38
- // Reactive accessorre-evaluates when mode changes.
39
- // Reading themeAttrs.mode inside the accessor creates a dependency
40
- // tracked by the runtime's effect (via mountReactive).
41
- // This ensures .attrs() callbacks see the current mode on mode switch.
42
- return (() => {
43
- const callbackParams = [
44
- themeAttrs.theme,
45
- { render, mode: themeAttrs.mode, isDark: themeAttrs.isDark, isLight: themeAttrs.isLight },
46
- ]
38
+ // Read theme attrs eagerly .attrs() callbacks run once at mount.
39
+ // Mode-dependent styling is handled reactively by the $rocketstyle
40
+ // accessor in EnhancedComponent, not by re-running attrs.
41
+ const callbackParams = [
42
+ themeAttrs.theme,
43
+ { render, mode: themeAttrs.mode, isDark: themeAttrs.isDark, isLight: themeAttrs.isLight },
44
+ ]
47
45
 
48
- const prioritizedAttrs = calculatePriorityAttrs([filteredProps, ...callbackParams])
46
+ const prioritizedAttrs = calculatePriorityAttrs([filteredProps, ...callbackParams])
49
47
 
50
- const finalAttrs = calculateAttrs([
51
- {
52
- ...prioritizedAttrs,
53
- ...filteredProps,
54
- },
55
- ...callbackParams,
56
- ])
57
-
58
- const finalProps = {
48
+ const finalAttrs = calculateAttrs([
49
+ {
59
50
  ...prioritizedAttrs,
60
- ...finalAttrs,
61
51
  ...filteredProps,
62
- }
52
+ },
53
+ ...callbackParams,
54
+ ])
55
+
56
+ const finalProps = {
57
+ ...prioritizedAttrs,
58
+ ...finalAttrs,
59
+ ...filteredProps,
60
+ }
63
61
 
64
- return WrappedComponent(finalProps)
65
- }) as unknown as ReturnType<ComponentFn<any>>
62
+ return WrappedComponent(finalProps)
66
63
  }
67
64
  return HOCComponent
68
65
  }
@@ -1,4 +1,4 @@
1
- import usePseudoState from "./usePseudoState"
2
- import useTheme from "./useTheme"
1
+ import usePseudoState from './usePseudoState'
2
+ import useTheme from './useTheme'
3
3
 
4
4
  export { usePseudoState, useTheme }
@@ -1,5 +1,5 @@
1
- import { signal } from "@pyreon/reactivity"
2
- import type { PseudoActions, PseudoState } from "../types/pseudo"
1
+ import { signal } from '@pyreon/reactivity'
2
+ import type { PseudoActions, PseudoState } from '../types/pseudo'
3
3
 
4
4
  type UsePseudoState = ({
5
5
  onMouseEnter,
@@ -9,7 +9,7 @@ type UsePseudoState = ({
9
9
  onFocus,
10
10
  onBlur,
11
11
  }: Partial<PseudoActions>) => {
12
- state: Pick<PseudoState, "hover" | "focus" | "pressed">
12
+ state: Pick<PseudoState, 'hover' | 'focus' | 'pressed'>
13
13
  events: PseudoActions
14
14
  }
15
15
 
@@ -1,7 +1,7 @@
1
- import { useContext } from "@pyreon/core"
2
- import { THEME_MODES_INVERSED } from "../constants"
3
- import { context } from "../context/context"
4
- import type { ThemeModeKeys } from "../types/theme"
1
+ import { useContext } from '@pyreon/core'
2
+ import { THEME_MODES_INVERSED } from '../constants'
3
+ import { context } from '../context/context'
4
+ import type { ThemeModeKeys } from '../types/theme'
5
5
 
6
6
  type Context = {
7
7
  theme: Record<string, unknown>
@@ -16,32 +16,29 @@ type UseThemeAttrs = ({ inversed }: { inversed?: boolean | undefined }) => Conte
16
16
  * Retrieves the current theme object and resolved mode from context.
17
17
  *
18
18
  * Returns an object with getter properties so that mode/isDark/isLight
19
- * are evaluated lazily on each access. This supports reactive mode
20
- * switching via PyreonUI when PyreonUI provides `get mode()` getters,
21
- * rocketstyle picks up changes on every styled component re-evaluation.
22
- *
23
- * Without getters, destructuring would capture the mode value once at
24
- * setup time, making theme switching permanently broken.
19
+ * are evaluated lazily on each access. The context is a ReactiveContext,
20
+ * so useContext returns `() => CoreContextValue` we call it inside
21
+ * each getter to ensure reactive tracking.
25
22
  */
26
23
  const useThemeAttrs: UseThemeAttrs = ({ inversed }) => {
27
- // Keep the context object reference — read its properties lazily via getters.
28
- // PyreonUI provides { get mode() {...} } so each access re-evaluates.
29
- const ctx = useContext<Context>(context) || ({} as Partial<Context>)
24
+ // ReactiveContext: useContext returns () => CoreContextValue.
25
+ // Call the getter inside each property getter for reactive tracking.
26
+ const getCtx = useContext(context)
30
27
 
31
28
  return {
32
29
  get theme() {
33
- return ctx.theme ?? ({} as Record<string, unknown>)
30
+ return getCtx().theme ?? ({} as Record<string, unknown>)
34
31
  },
35
32
  get mode() {
36
- const ctxMode = ctx.mode ?? "light"
33
+ const ctxMode = getCtx().mode ?? 'light'
37
34
  return inversed ? THEME_MODES_INVERSED[ctxMode] : ctxMode
38
35
  },
39
36
  get isDark() {
40
- const ctxDark = ctx.isDark ?? false
37
+ const ctxDark = getCtx().isDark ?? false
41
38
  return inversed ? !ctxDark : ctxDark
42
39
  },
43
40
  get isLight() {
44
- const ctxDark = ctx.isDark ?? false
41
+ const ctxDark = getCtx().isDark ?? false
45
42
  const isDark = inversed ? !ctxDark : ctxDark
46
43
  return !isDark
47
44
  },
package/src/index.ts CHANGED
@@ -1,10 +1,10 @@
1
- import type { TProvider } from "./context/context"
2
- import Provider, { context } from "./context/context"
3
- import type { Rocketstyle } from "./init"
4
- import rocketstyle from "./init"
5
- import type { IsRocketComponent } from "./isRocketComponent"
6
- import isRocketComponent from "./isRocketComponent"
7
- import type { AttrsCb } from "./types/attrs"
1
+ import type { TProvider } from './context/context'
2
+ import Provider, { context } from './context/context'
3
+ import type { Rocketstyle } from './init'
4
+ import rocketstyle from './init'
5
+ import type { IsRocketComponent } from './isRocketComponent'
6
+ import isRocketComponent from './isRocketComponent'
7
+ import type { AttrsCb } from './types/attrs'
8
8
  import type {
9
9
  ConfigAttrs,
10
10
  ConsumerCb,
@@ -12,8 +12,8 @@ import type {
12
12
  ConsumerCtxCb,
13
13
  RocketComponentType,
14
14
  RocketProviderState,
15
- } from "./types/config"
16
- import type { DefaultProps } from "./types/configuration"
15
+ } from './types/config'
16
+ import type { DefaultProps } from './types/configuration'
17
17
  import type {
18
18
  DimensionCallbackParam,
19
19
  DimensionProps,
@@ -22,18 +22,18 @@ import type {
22
22
  ExtractDimensionProps,
23
23
  ExtractDimensions,
24
24
  TDKP,
25
- } from "./types/dimensions"
26
- import type { ComposeParam, GenericHoc } from "./types/hoc"
27
- import type { IRocketStyleComponent, RocketStyleComponent } from "./types/rocketstyle"
28
- import type { RocketStyleInterpolationProps, StylesCb, StylesDefault } from "./types/styles"
25
+ } from './types/dimensions'
26
+ import type { ComposeParam, GenericHoc } from './types/hoc'
27
+ import type { IRocketStyleComponent, RocketStyleComponent } from './types/rocketstyle'
28
+ import type { RocketStyleInterpolationProps, StylesCb, StylesDefault } from './types/styles'
29
29
  import type {
30
30
  ThemeCb,
31
31
  ThemeDefault,
32
32
  ThemeMode,
33
33
  ThemeModeCallback,
34
34
  ThemeModeKeys,
35
- } from "./types/theme"
36
- import type { ComponentFn, ElementType, ExtractProps, MergeTypes, TObj } from "./types/utils"
35
+ } from './types/theme'
36
+ import type { ComponentFn, ElementType, ExtractProps, MergeTypes, TObj } from './types/utils'
37
37
 
38
38
  export type {
39
39
  AttrsCb,
@@ -73,5 +73,22 @@ export type {
73
73
  TProvider,
74
74
  }
75
75
 
76
+ /**
77
+ * Resolve a $rocketstyle value — handles both function accessor and plain object.
78
+ * Use in styled() interpolation functions when $rocketstyle may be a reactive accessor.
79
+ *
80
+ * @example
81
+ * ```ts
82
+ * styled(Component)`
83
+ * color: ${(props) => resolveTheme(props.$rocketstyle).color};
84
+ * `
85
+ * ```
86
+ */
87
+ export function resolveTheme<T = Record<string, unknown>>(
88
+ value: (() => T) | T,
89
+ ): T {
90
+ return typeof value === 'function' ? (value as () => T)() : value
91
+ }
92
+
76
93
  export { context, isRocketComponent, Provider, rocketstyle }
77
94
  export default rocketstyle
package/src/init.ts CHANGED
@@ -1,16 +1,16 @@
1
- import { isEmpty } from "@pyreon/ui-core"
2
- import { ALL_RESERVED_KEYS } from "./constants"
3
- import defaultDimensions from "./constants/defaultDimensions"
4
- import rocketComponent from "./rocketstyle"
5
- import type { DefaultDimensions, Dimensions } from "./types/dimensions"
6
- import type { RocketComponent } from "./types/rocketComponent"
7
- import type { ElementType } from "./types/utils"
1
+ import { isEmpty } from '@pyreon/ui-core'
2
+ import { ALL_RESERVED_KEYS } from './constants'
3
+ import defaultDimensions from './constants/defaultDimensions'
4
+ import rocketComponent from './rocketstyle'
5
+ import type { DefaultDimensions, Dimensions } from './types/dimensions'
6
+ import type { RocketComponent } from './types/rocketComponent'
7
+ import type { ElementType } from './types/utils'
8
8
  import {
9
9
  getDimensionsValues,
10
10
  getKeys,
11
11
  getMultipleDimensions,
12
12
  getTransformDimensions,
13
- } from "./utils/dimensions"
13
+ } from './utils/dimensions'
14
14
 
15
15
  export type Rocketstyle = <
16
16
  const D extends Dimensions = DefaultDimensions,
@@ -45,15 +45,15 @@ const validateInit = (name: string, component: unknown, dimensions: Dimensions)
45
45
  const errors: InitErrors = {}
46
46
 
47
47
  if (!component) {
48
- errors.component = "Parameter `component` is missing in params!"
48
+ errors.component = 'Parameter `component` is missing in params!'
49
49
  }
50
50
 
51
51
  if (!name) {
52
- errors.name = "Parameter `name` is missing in params!"
52
+ errors.name = 'Parameter `name` is missing in params!'
53
53
  }
54
54
 
55
55
  if (isEmpty(dimensions)) {
56
- errors.dimensions = "Parameter `dimensions` is missing in params!"
56
+ errors.dimensions = 'Parameter `dimensions` is missing in params!'
57
57
  } else {
58
58
  const definedDimensions = getKeys(dimensions)
59
59
  const invalidDimension = ALL_RESERVED_KEYS.some((item) =>
@@ -73,7 +73,7 @@ const validateInit = (name: string, component: unknown, dimensions: Dimensions)
73
73
 
74
74
  const rocketstyle = (({ dimensions = defaultDimensions, useBooleans = true } = {}) =>
75
75
  ({ name, component }: { name: string; component: any }) => {
76
- if (process.env.NODE_ENV !== "production") {
76
+ if (process.env.NODE_ENV !== 'production') {
77
77
  validateInit(name, component, dimensions)
78
78
  }
79
79
 
@@ -4,8 +4,8 @@ export type IsRocketComponent = <T>(component: T) => boolean
4
4
  const isRocketComponent: IsRocketComponent = (component) => {
5
5
  if (
6
6
  component &&
7
- (typeof component === "object" || typeof component === "function") &&
8
- Object.hasOwn(component as object, "IS_ROCKETSTYLE")
7
+ (typeof component === 'object' || typeof component === 'function') &&
8
+ Object.hasOwn(component as object, 'IS_ROCKETSTYLE')
9
9
  ) {
10
10
  return true
11
11
  }