@gild-ui/react-native 0.1.0-alpha.1 → 0.1.0-alpha.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.
package/README.md CHANGED
@@ -53,6 +53,10 @@ export default function App() {
53
53
  `Typography`, `Button`, `TextInput` and `Modal`. Every other component of `@gild-ui/react` comes later.
54
54
  Each component's README says what a phone does with each prop.
55
55
 
56
+ ## Right to left
57
+
58
+ Opt in once, in `setup()`: `configure({ serverTheme: themes.light, plugins: [rtl()] })`, with `rtl` from `@gild-ui/react-native/engine`. `Direction` (`@gild-ui/react-native/Direction`) lays a subtree out in its direction at once; with the plugin, what the platform does not mirror (a `translateX`, the width of a shadow offset, `textAlign`) flips as well, and `dir({ ltr, rtl })` picks its side from the nearest `Direction`. The plugin never flips layout: the platform does that under `direction`.
59
+
56
60
  ## How it maps the web's props
57
61
 
58
62
  - **`aria-*` and `role`** go to the native element, which takes them from React Native 0.71 (`aria-label`,
package/dist/Button.d.cts CHANGED
@@ -1,3 +1,3 @@
1
- import { $ as ButtonVariant, G as ButtonColor, J as ButtonProps, K as ButtonLoadingPosition, Q as ButtonThemeConfig, X as ButtonSize, Y as ButtonShape, Z as ButtonSlot, et as GapToken, q as ButtonOwnerState } from "./themes-DK6h0IiW.cjs";
1
+ import { $ as ButtonThemeConfig, J as ButtonOwnerState, K as ButtonColor, Q as ButtonSlot, X as ButtonShape, Y as ButtonProps, Z as ButtonSize, et as ButtonVariant, q as ButtonLoadingPosition, tt as GapToken } from "./themes-ixg3A3lF.cjs";
2
2
  export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
3
3
  export type { ButtonColor, ButtonLoadingPosition, ButtonOwnerState, ButtonProps, ButtonShape, ButtonSize, ButtonSlot, ButtonThemeConfig, ButtonVariant, GapToken };
package/dist/Button.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { a as ButtonShape, c as ButtonThemeConfig, i as ButtonProps, l as ButtonVariant, n as ButtonLoadingPosition, o as ButtonSize, r as ButtonOwnerState, s as ButtonSlot, t as ButtonColor, u as GapToken } from "./Button.types-Bb9gBlbS.mjs";
1
+ import { a as ButtonShape, c as ButtonThemeConfig, i as ButtonProps, l as ButtonVariant, n as ButtonLoadingPosition, o as ButtonSize, r as ButtonOwnerState, s as ButtonSlot, t as ButtonColor, u as GapToken } from "./Button.types-C8OB0OAz.mjs";
2
2
  export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
3
3
  export type { ButtonColor, ButtonLoadingPosition, ButtonOwnerState, ButtonProps, ButtonShape, ButtonSize, ButtonSlot, ButtonThemeConfig, ButtonVariant, GapToken };
@@ -2,7 +2,8 @@ import { SheetStyleProp } from "@umber-style/react-native";
2
2
  import { ButtonVariants, InputVariantKey, OpenScale, Register as Register$1, RegisteredTheme, Theme as Theme$1, ThemeBackground, ThemeColor, ThemeFonts, ThemeRadii, ThemeSize, ThemeSpaceKey, ThemeText, ThemeTransitionEasing, ThemeTypography, ThemeZOrder, TypographyVariant, VariantOf } from "@gild-ui/core/theme";
3
3
  import { ButtonHTMLAttributes, CSSProperties, ChangeEventHandler, ComponentProps, ComponentPropsWithRef, ComponentType, ElementType, FunctionComponent, HTMLAttributes, InputHTMLAttributes, JSX, ReactNode, TextareaHTMLAttributes } from "react";
4
4
  import { BorderProps, FlexboxProps, LayoutFrameProps, LayoutProps, PositionProps, SpaceProps, SpanProps, TypographyProps as TypographyProps$1 } from "@soroush.tech/styled-system";
5
- import { BindingOptions as BindingOptions$1, CSSObject as CSSObject$1, ColorScheme as ColorScheme$1, CssArgument as CssArgument$1, GlobalInput as GlobalInput$1, Interpolation as Interpolation$1, InterpolationResult as InterpolationResult$1, PropsTaking as PropsTaking$1, SerializedStyles as SerializedStyles$1, SheetEntry as SheetEntry$1, SheetStyles as SheetStyles$1, StaticTemplateValue as StaticTemplateValue$1, StyleInput as StyleInput$1, StyleTypeOptions as StyleTypeOptions$1, StylerOptions as StylerOptions$1, TemplateValue as TemplateValue$1, Theme as Theme$3, ThemeInput as ThemeInput$1, ThemedEntry as ThemedEntry$1, WebStyleObject as WebStyleObject$1, WrapperOwnStatics as WrapperOwnStatics$1 } from "@umber-style/core";
5
+ import { BindingOptions as BindingOptions$1, CSSObject as CSSObject$1, CachePlugin, CachePlugin as CachePlugin$1, ColorScheme as ColorScheme$1, CssArgument as CssArgument$1, GlobalInput as GlobalInput$1, Interpolation as Interpolation$1, InterpolationResult as InterpolationResult$1, PropsTaking as PropsTaking$1, SerializedStyles as SerializedStyles$1, SheetEntry as SheetEntry$1, SheetStyles as SheetStyles$1, StaticTemplateValue as StaticTemplateValue$1, StyleInput as StyleInput$1, StyleTypeOptions as StyleTypeOptions$1, StylerOptions as StylerOptions$1, TemplateValue as TemplateValue$1, Theme as Theme$3, ThemeInput as ThemeInput$1, ThemeRefs, ThemeRefs as ThemeRefs$1, ThemedEntry as ThemedEntry$1, WebStyleObject as WebStyleObject$1, WrapperOwnStatics as WrapperOwnStatics$1 } from "@umber-style/core";
6
+ import "@umber-style/core/internal";
6
7
  /** What the `style` prop of a component takes: an entry of the binding's `StyleSheet`, or a list of them. */
7
8
  type StyleOverride = SheetStyleProp;
8
9
  /**
@@ -20,18 +21,6 @@ type StrictStyled<C extends ElementType> = FunctionComponent<Omit<ComponentProps
20
21
  style?: StyleOverride;
21
22
  slotProps?: SlotProps<'root'>;
22
23
  }>;
23
- /** What only the client build of the React binding takes: it can render the style of its classes on a server. */
24
- interface ServerStyleOptions {
25
- /**
26
- * Whether, where there is no `document` (the server render of a client component), a styled element and a
27
- * theme provider render the `<style href precedence>` elements of their classes, as the server components
28
- * build does. React moves them to the head and renders each `href` once, so the first HTML of a page
29
- * is styled whichever build rendered a component. In the browser the client build inserts into its sheet
30
- * and renders none, whatever this is. Default true. Set it to false when a classic server render
31
- * puts the CSS of the page into one style element of its own (`extractPageStyles`, `createStyleTag`).
32
- */
33
- hasServerStyleElements?: boolean;
34
- }
35
24
  /**
36
25
  * The theme of the default style of this binding: what `styled`, `useTheme`, `StyleSheet` and
37
26
  * `ThemeProvider` of the default style read. It extends the core's `Theme`, so an app gives it members
@@ -47,7 +36,73 @@ interface Theme$2 extends Theme$3 {
47
36
  * of the props and the theme, nothing, or a list of them. The core's `Interpolation`, with this binding's
48
37
  * `Theme` unless another is given.
49
38
  */
50
- type Interpolation<Props = unknown, T = Theme$2> = Interpolation$1<Props, T>;
39
+ type Interpolation<Props = unknown, T = ThemeRefs$1<Theme$2>> = Interpolation$1<Props, T>;
40
+ /**
41
+ * What the `theme` of a provider of the theme `T` takes: `ThemeInput<T>`. The `Theme` of the default style
42
+ * has no member of its own until an app declares its members in it, and until then no theme of the app
43
+ * would match it (TypeScript rejects an object that shares no member with a type whose members are all
44
+ * optional); so while it has none, the provider takes any theme object, or a function of the theme above
45
+ * whose parameter the app types (`(outer: AppTheme) => AppTheme`).
46
+ */
47
+ type ProviderThemeInput<T> = [Exclude<keyof T, '_theme'>] extends [never] ? object | UntypedThemeFunction['derive'] : ThemeInput$1<T>;
48
+ /**
49
+ * The function form of `ProviderThemeInput` for a theme with no members: its parameter is compared both
50
+ * ways, as a method's is, so a function whose parameter the app types as its own theme is taken.
51
+ */
52
+ interface UntypedThemeFunction {
53
+ derive(outer: object): object;
54
+ }
55
+ /** The props of `ThemeProvider`: the theme of the subtree, and on the web its color scheme and wrapper. */
56
+ interface ThemeProviderProps<T> {
57
+ /**
58
+ * The theme, or the part of it that this subtree changes; or a function of the theme above (the base
59
+ * theme, or an empty object, for the outermost provider) that returns it. It is merged over the theme above.
60
+ */
61
+ readonly theme: ProviderThemeInput<T>;
62
+ /** Web only. */
63
+ readonly colorScheme?: ColorScheme$1;
64
+ /** Web only: a class of the wrapper of a nested provider. */
65
+ readonly className?: string;
66
+ /**
67
+ * Web only. Renders no element, no class and no rule: the app puts `themeClass(theme)` on an ancestor,
68
+ * usually `<html>`. The theme still reaches the engine and the context. Without it the outermost provider
69
+ * declares its theme on `:root`, and renders no element either.
70
+ */
71
+ readonly isRoot?: boolean;
72
+ /** The subtree that the theme applies to. */
73
+ readonly children?: ReactNode;
74
+ }
75
+ /** The props of `ThemeScope`. */
76
+ interface ThemeScopeProps {
77
+ /** The content to wrap in the wrapper of the nearest nested provider: what a portal renders elsewhere. */
78
+ readonly children?: ReactNode;
79
+ }
80
+ /** The props of `Global`. */
81
+ interface GlobalProps<T> {
82
+ /**
83
+ * The global styles: a handle that `globalStyles` made, a style object, a function of the theme, or a
84
+ * list of them, written in the order of the list. A function of the theme reads the nearest provider:
85
+ * tokens are references, raw keys (`breakpoints`) are its real values.
86
+ */
87
+ readonly styles: GlobalInput$1<T>;
88
+ }
89
+ /** The props of `ThemeProvider` on the web: those of every platform, and the element of the wrapper. */
90
+ interface WebThemeProviderProps<T> extends ThemeProviderProps<T> {
91
+ /** The element of the wrapper of a nested provider. Default 'div'. */
92
+ readonly as?: string;
93
+ }
94
+ /** What only the client build of the React binding takes: it can render the style of its classes on a server. */
95
+ interface ServerStyleOptions {
96
+ /**
97
+ * Whether, where there is no `document` (the server render of a client component), a styled element and a
98
+ * theme provider render the `<style href precedence>` elements of their classes, as the server components
99
+ * build does. React moves them to the head and renders each `href` once, so the first HTML of a page
100
+ * is styled whichever build rendered a component. In the browser the client build inserts into its sheet
101
+ * and renders none, whatever this is. Default true. Set it to false when a classic server render
102
+ * puts the CSS of the page into one style element of its own (`extractPageStyles`, `createStyleTag`).
103
+ */
104
+ hasServerStyleElements?: boolean;
105
+ }
51
106
  /**
52
107
  * The options of `configure()`: those of `StyleOptions` for the engine of the default style, and the
53
108
  * theme of anything with no provider. Call it once for the program, in a `setup` module that runs on the
@@ -69,6 +124,14 @@ interface DefaultStyleOptions extends BindingOptions$1<Theme$2>, ServerStyleOpti
69
124
  * @deprecated The same as `serverTheme`, which is its name now.
70
125
  */
71
126
  theme?: Theme$2;
127
+ /**
128
+ * What each declaration of the default style goes through before it is written, in order: in the cache it
129
+ * makes, a cache it is given and the cache of a `CacheProvider`, in client and server components. A plugin
130
+ * keeps a declaration, changes it, replaces it with several, or puts them under a condition of the rule's
131
+ * selector (`rtl()` of `@umber-style/rtl`). Set only here; their names are part of the stamp of the cache
132
+ * that the default style makes. Default none: the output is the same as without the option.
133
+ */
134
+ plugins?: readonly CachePlugin$1[];
72
135
  }
73
136
  /**
74
137
  * The options of `styled(tag, options)`: the label of the class, which props reach the element, and a class
@@ -166,7 +229,7 @@ type ElementProps<ComponentProps extends object, SpecificComponentProps extends
166
229
  * The props of the component's own are a type argument, `AdditionalProps`. A function style reads all of
167
230
  * them, the component's own over the others, and `theme`, the theme `T`.
168
231
  */
169
- interface CreateStyledComponent<ComponentProps extends object, SpecificComponentProps extends object = object, JSXProps extends object = object, T = Theme$2> {
232
+ interface CreateStyledComponent<ComponentProps extends object, SpecificComponentProps extends object = object, JSXProps extends object = object, T = ThemeRefs$1<Theme$2>> {
170
233
  <AdditionalProps extends object = object>(style: (props: StyleFunctionProps<ComponentProps & SpecificComponentProps, AdditionalProps> & {
171
234
  theme: T;
172
235
  }) => InterpolationResult$1, ...styles: Interpolation<StyleFunctionProps<ComponentProps & SpecificComponentProps, AdditionalProps>, T>[]): StyledComponent<ElementType, AdditionalProps, ElementProps<ComponentProps, SpecificComponentProps, JSXProps>>;
@@ -200,60 +263,6 @@ interface SheetDefinition<S extends SheetStyles$1, E> {
200
263
  /** Never set at run time: it only carries the types. */
201
264
  readonly entries?: { [K in keyof S]: E; };
202
265
  }
203
- /**
204
- * What the `theme` of a provider of the theme `T` takes: `ThemeInput<T>`. The `Theme` of the default style
205
- * has no member of its own until an app declares its members in it, and until then no theme of the app
206
- * would match it (TypeScript rejects an object that shares no member with a type whose members are all
207
- * optional); so while it has none, the provider takes any theme object, or a function of the theme above
208
- * whose parameter the app types (`(outer: AppTheme) => AppTheme`).
209
- */
210
- type ProviderThemeInput<T> = [Exclude<keyof T, '_theme'>] extends [never] ? object | UntypedThemeFunction['derive'] : ThemeInput$1<T>;
211
- /**
212
- * The function form of `ProviderThemeInput` for a theme with no members: its parameter is compared both
213
- * ways, as a method's is, so a function whose parameter the app types as its own theme is taken.
214
- */
215
- interface UntypedThemeFunction {
216
- derive(outer: object): object;
217
- }
218
- /** The props of `ThemeProvider`: the theme of the subtree, and on the web its color scheme and wrapper. */
219
- interface ThemeProviderProps<T> {
220
- /**
221
- * The theme, or the part of it that this subtree changes; or a function of the theme above (the base
222
- * theme, or an empty object, for the outermost provider) that returns it. It is merged over the theme above.
223
- */
224
- readonly theme: ProviderThemeInput<T>;
225
- /** Web only. */
226
- readonly colorScheme?: ColorScheme$1;
227
- /** Web only: a class of the wrapper of a nested provider. */
228
- readonly className?: string;
229
- /**
230
- * Web only. Renders no element, no class and no rule: the app puts `themeClass(theme)` on an ancestor,
231
- * usually `<html>`. The theme still reaches the engine and the context. Without it the outermost provider
232
- * declares its theme on `:root`, and renders no element either.
233
- */
234
- readonly isRoot?: boolean;
235
- /** The subtree that the theme applies to. */
236
- readonly children?: ReactNode;
237
- }
238
- /** The props of `ThemeScope`. */
239
- interface ThemeScopeProps {
240
- /** The content to wrap in the wrapper of the nearest nested provider: what a portal renders elsewhere. */
241
- readonly children?: ReactNode;
242
- }
243
- /** The props of `Global`. */
244
- interface GlobalProps<T> {
245
- /**
246
- * The global styles: a handle that `globalStyles` made, a style object, a function of the theme, or a
247
- * list of them, written in the order of the list. A function of the theme reads the nearest provider:
248
- * tokens are references, raw keys (`breakpoints`) are its real values.
249
- */
250
- readonly styles: GlobalInput$1<T>;
251
- }
252
- /** The props of `ThemeProvider` on the web: those of every platform, and the element of the wrapper. */
253
- interface WebThemeProviderProps<T> extends ThemeProviderProps<T> {
254
- /** The element of the wrapper of a nested provider. Default 'div'. */
255
- readonly as?: string;
256
- }
257
266
  /**
258
267
  * A component that `withTheme` or `withStyle` made from the component `C`: it takes the props of `C` and
259
268
  * its `ref` (the instance of a class component), without `Name` (`theme` or `styles`), which it gives
@@ -267,9 +276,9 @@ type WrappedComponent<C extends ElementType, Name extends string> = FunctionComp
267
276
  type StyleWrapper<Styles> = <C extends ComponentType<PropsTaking$1<ComponentProps<C>, 'styles', Styles>>>(component: C) => WrappedComponent<C, 'styles'>;
268
277
  /** The setter of `useStyleValue`: a new number, or a function of the number before. */
269
278
  type StyleValueSetter = (next: number | ((previous: number) => number)) => void;
270
- declare const configure: (options: DefaultStyleOptions) => void, getEngine: () => import("@umber-style/core").Engine<Theme$2>, styled: Styled<Theme$2>, StyleSheet: {
279
+ declare const configure: (options: DefaultStyleOptions) => void, getEngine: () => import("@umber-style/core").Engine<Theme$2>, styled: Styled<import("@umber-style/core").ThemeRefs<Theme$2>>, StyleSheet: {
271
280
  create<K extends string>(styles: import("@umber-style/core").ObjectSheet<K>): { readonly [P in K]: import("@umber-style/core").SheetEntry; };
272
- create<K extends string>(styles: (theme: Theme$2) => Record<K, import("@umber-style/core").WebStyleObject>): SheetDefinition<Record<K, import("@umber-style/core").WebStyleObject>, import("@umber-style/core").SheetEntry> & import("@umber-style/core").ThemedEntries<K>;
281
+ create<K extends string>(styles: (theme: NoInfer<import("@umber-style/core").ThemeRefs<Theme$2>>) => Record<K, import("@umber-style/core").WebStyleObject>): SheetDefinition<Record<K, import("@umber-style/core").WebStyleObject>, import("@umber-style/core").SheetEntry> & import("@umber-style/core").ThemedEntries<K>;
273
282
  }, useStyle: {
274
283
  <K extends string>(sheet: { readonly [P in K]: import("@umber-style/core").SheetEntry; }): { readonly [P in K]: import("@umber-style/core").SheetEntry; };
275
284
  <K extends string>(sheet: SheetDefinition<Record<K, import("@umber-style/core").WebStyleObject>, import("@umber-style/core").SheetEntry> & import("@umber-style/core").ThemedEntries<K>): { [P in K]: import("@umber-style/core").SheetEntry; };
@@ -278,17 +287,17 @@ declare const configure: (options: DefaultStyleOptions) => void, getEngine: () =
278
287
  <K extends string>(sheet: { readonly [P in K]: import("@umber-style/core").SheetEntry; }): StyleWrapper<{ readonly [P in K]: import("@umber-style/core").SheetEntry; }>;
279
288
  <K extends string>(sheet: SheetDefinition<Record<K, import("@umber-style/core").WebStyleObject>, import("@umber-style/core").SheetEntry> & import("@umber-style/core").ThemedEntries<K>): StyleWrapper<{ [P in K]: import("@umber-style/core").SheetEntry; }>;
280
289
  <S extends import("@umber-style/core").SheetStyles>(sheet: SheetDefinition<S, import("@umber-style/core").SheetEntry>): StyleWrapper<{ [K in keyof S]: import("@umber-style/core").SheetEntry; }>;
281
- }, useStyleValue: (initial: number, unit?: string) => [import("@umber-style/core").LiveValue, StyleValueSetter], useTheme: () => Theme$2, withTheme: <C extends import("react").ComponentType<import("@umber-style/core").PropsTaking<import("react").ComponentProps<C>, 'theme', Theme$2>>>(component: C) => WrappedComponent<C, "theme">, ThemeProvider: (props: WebThemeProviderProps<Theme$2>) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>, ThemeScope: (props: ThemeScopeProps) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>, useThemeClass: () => string | undefined, ThemeContext: import("react").Context<Theme$2 | undefined>, apply: (...entries: (import("@umber-style/core").SheetEntry | string | null | undefined | false)[]) => {
290
+ }, useStyleValue: (initial: number, unit?: string) => [import("@umber-style/core").LiveValue, StyleValueSetter], useTheme: () => Theme$2, withTheme: <C extends import("react").ComponentType<import("@umber-style/core").PropsTaking<import("react").ComponentProps<C>, 'theme', Theme$2>>>(component: C) => WrappedComponent<C, "theme">, ThemeProvider: (props: WebThemeProviderProps<Theme$2>) => import("react").ReactElement, ThemeScope: (props: ThemeScopeProps) => import("react").ReactElement, useThemeClass: () => string | undefined, ThemeContext: import("react").Context<Theme$2 | undefined>, apply: (...entries: (import("@umber-style/core").SheetEntry | string | null | undefined | false)[]) => {
282
291
  className?: string;
283
292
  }, css: CssFunction, themeClass: (theme: import("@umber-style/core").DeepPartialObject<Theme$2>, colorScheme?: import("@umber-style/core").ColorScheme) => string, when: (theme: import("@umber-style/core").DeepPartialObject<Theme$2>, colorScheme?: import("@umber-style/core").ColorScheme) => import("@umber-style/core").ThemeKey, whenScheme: (scheme: import("@umber-style/core").SchemeName) => import("@umber-style/core").SchemeKey, keyframes: {
284
- (steps: (theme: Theme$2) => import("@umber-style/core").KeyframesSteps, options?: import("@umber-style/core").KeyframesOptions): import("@umber-style/core").Keyframes;
285
- (template: TemplateStringsArray, ...values: import("@umber-style/core").TemplateValue<unknown, Theme$2>[]): import("@umber-style/core").Keyframes;
286
- (steps: import("@umber-style/core").KeyframesInput<Theme$2>, options?: import("@umber-style/core").KeyframesOptions): import("@umber-style/core").Keyframes;
293
+ (steps: (theme: NoInfer<import("@umber-style/core").ThemeRefs<Theme$2>>) => import("@umber-style/core").KeyframesSteps, options?: import("@umber-style/core").KeyframesOptions): import("@umber-style/core").Keyframes;
294
+ (template: TemplateStringsArray, ...values: import("@umber-style/core").TemplateValue<unknown, NoInfer<import("@umber-style/core").ThemeRefs<Theme$2>>>[]): import("@umber-style/core").Keyframes;
295
+ (steps: import("@umber-style/core").KeyframesInput<NoInfer<import("@umber-style/core").ThemeRefs<Theme$2>>>, options?: import("@umber-style/core").KeyframesOptions): import("@umber-style/core").Keyframes;
287
296
  }, globalStyles: {
288
- (styles: (theme: Theme$2) => import("@umber-style/core").GlobalStyleObject): import("@umber-style/core").GlobalStyles<Theme$2>;
289
- (template: TemplateStringsArray, ...values: import("@umber-style/core").TemplateValue<unknown, Theme$2>[]): import("@umber-style/core").GlobalStyles<Theme$2>;
290
- (styles: import("@umber-style/core").GlobalStylesInput<Theme$2>): import("@umber-style/core").GlobalStyles<Theme$2>;
291
- }, Global: (props: GlobalProps<Theme$2>) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | null;
297
+ (styles: (theme: NoInfer<import("@umber-style/core").ThemeRefs<Theme$2>>) => import("@umber-style/core").GlobalStyleObject): import("@umber-style/core").GlobalStyles<NoInfer<import("@umber-style/core").ThemeRefs<Theme$2>>>;
298
+ (template: TemplateStringsArray, ...values: import("@umber-style/core").TemplateValue<unknown, NoInfer<import("@umber-style/core").ThemeRefs<Theme$2>>>[]): import("@umber-style/core").GlobalStyles<NoInfer<import("@umber-style/core").ThemeRefs<Theme$2>>>;
299
+ (styles: import("@umber-style/core").GlobalStylesInput<NoInfer<import("@umber-style/core").ThemeRefs<Theme$2>>>): import("@umber-style/core").GlobalStyles<NoInfer<import("@umber-style/core").ThemeRefs<Theme$2>>>;
300
+ }, Global: (props: GlobalProps<NoInfer<import("@umber-style/core").ThemeRefs<Theme$2>>>) => import("react").ReactElement | null;
292
301
  /** The defaults a theme may set for every `Accordion`. */
293
302
  interface AccordionOwnerState {
294
303
  hasGutters?: boolean;
@@ -528,7 +537,6 @@ type ViewSlot = 'root';
528
537
  /** What `theme.components.View` takes. */
529
538
  type ViewThemeConfig = ComponentConfig<ViewOwnerState, ViewSlot>;
530
539
  declare const View: StrictStyled<StyledComponent<import("react").ElementType, ViewProps, {
531
- theme?: AppTheme;
532
540
  as?: React.ElementType;
533
541
  } & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & object>>;
534
542
  /** Valid values for the gap prop - derived from theme.space keys. */
@@ -546,7 +554,6 @@ type FlexSlot = 'root';
546
554
  /** What `theme.components.Flex` takes. */
547
555
  type FlexThemeConfig = ComponentConfig<FlexOwnerState, FlexSlot>;
548
556
  declare const Flex: StrictStyled<StyledComponent<import("react").ElementType, FlexProps, Omit<Omit<{
549
- theme?: AppTheme;
550
557
  as?: React.ElementType;
551
558
  } & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & object, "as" | keyof ViewProps> & Omit<ViewProps, "style"> & {
552
559
  as?: "a" | "abbr" | "address" | "animate" | "animateMotion" | "animateTransform" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "center" | "circle" | "cite" | "clipPath" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "defs" | "del" | "desc" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "ellipse" | "em" | "embed" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "fieldset" | "figcaption" | "figure" | "filter" | "footer" | "foreignObject" | "form" | "g" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "image" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "line" | "linearGradient" | "link" | "main" | "map" | "mark" | "marker" | "mask" | "menu" | "menuitem" | "meta" | "metadata" | "meter" | "mpath" | "nav" | "noindex" | "noscript" | "object" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "path" | "pattern" | "picture" | "polygon" | "polyline" | "pre" | "progress" | "q" | "radialGradient" | "rect" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "search" | "section" | "select" | "set" | "slot" | "small" | "source" | "span" | "stop" | "strong" | "style" | "sub" | "summary" | "sup" | "svg" | "switch" | "symbol" | "table" | "tbody" | "td" | "template" | "text" | "textPath" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "tspan" | "u" | "ul" | "use" | "var" | "video" | "view" | "wbr" | "webview" | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
@@ -554,8 +561,6 @@ declare const Flex: StrictStyled<StyledComponent<import("react").ElementType, Fl
554
561
  }, "slotProps" | "style"> & {
555
562
  style?: StyleOverride;
556
563
  slotProps?: SlotProps<'root'>;
557
- } & {
558
- theme?: AppTheme;
559
564
  } & object>>;
560
565
  type PaperElevation = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24;
561
566
  /** The defaults a theme may set for every `Menu`. */
@@ -1337,6 +1342,24 @@ interface Theme extends Theme$1 {
1337
1342
  type GildTheme = Theme;
1338
1343
  /** The theme the app registered (see `Register` in the core), or this package's `Theme` when it registered none. */
1339
1344
  type AppTheme = RegisteredTheme<Theme>;
1345
+ /** The parts of the theme that a style function reads as they are: the same ones `baseTheme` marks with `asIs`. */
1346
+ interface StyleThemeModes {
1347
+ readonly $modes: {
1348
+ readonly defaults: 'asIs';
1349
+ readonly typography: 'asIs';
1350
+ readonly sizes: 'asIs';
1351
+ readonly layout: 'asIs';
1352
+ readonly transitions: 'asIs';
1353
+ };
1354
+ }
1355
+ /**
1356
+ * The theme a style function is given (`styled`, `StyleSheet.create`, `keyframes`, `Global`): each token
1357
+ * is the CSS variable that holds it, and the parts that are not CSS values (`sizes`, `typography`,
1358
+ * `layout`, `transitions`, `breakpoints`, `components`, `defaults`) are what they are. A function given to
1359
+ * `Global`, `StyleSheet.create` or `keyframes` (the engine's own, with no modes of the theme) is given
1360
+ * `EngineStyleTheme`.
1361
+ */
1362
+ type StyleTheme = ThemeRefs<AppTheme & StyleThemeModes>;
1340
1363
  /** The corner shapes of a control or a surface. */
1341
1364
  type ShapeKey = 'square' | 'rounded' | 'pill';
1342
1365
  /** The resolved props Button's styled roots receive - what `ownerState` exposes. */
@@ -1399,4 +1422,4 @@ interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'col
1399
1422
  /** Overrides for the slots a theme can style: `style`, `className`, `data-*` and `aria-*`. */
1400
1423
  slotProps?: SlotProps<ButtonSlot>;
1401
1424
  }
1402
- export { ViewSlot as $, TextInputTextColor as A, FlexOwnerState as B, TypographyVariant as C, TextInputProps as D, TextInputOwnerState as E, ModalProps as F, View as G, FlexSlot as H, ModalScroll as I, ViewBorderRadiusToken as J, ViewBackgroundToken as K, ModalSlot as L, TextInputVariant as M, ModalCloseReason as N, TextInputSize as O, ModalOwnerState as P, ViewProps as Q, ModalThemeConfig as R, TypographyThemeConfig as S, TextInputColor as T, FlexThemeConfig as U, FlexProps as V, GapToken$1 as W, ViewColorToken as X, ViewBorderWidthToken as Y, ViewOwnerState as Z, TextColorToken as _, ButtonShape as a, TypographyProps as b, ButtonThemeConfig as c, AppTheme as d, ViewThemeConfig as et, ComponentConfig as f, BackgroundToken as g, ThemeComponents as h, ButtonProps as i, StyleOverride as it, TextInputThemeConfig as j, TextInputSlot as k, ButtonVariant as l, Theme as m, ButtonLoadingPosition as n, SlotOverride as nt, ButtonSize as o, GildTheme as p, ViewBorderColorToken as q, ButtonOwnerState as r, SlotProps as rt, ButtonSlot as s, ButtonColor as t, configure as tt, GapToken as u, TypographyAlign as v, TextInputClasses as w, TypographySlot as x, TypographyOwnerState as y, Flex as z };
1425
+ export { ViewProps as $, TextInputSlot as A, Flex as B, TypographyThemeConfig as C, TextInputOwnerState as D, TextInputColor as E, ModalOwnerState as F, GapToken$1 as G, FlexProps as H, ModalProps as I, ViewBorderColorToken as J, View as K, ModalScroll as L, TextInputThemeConfig as M, TextInputVariant as N, TextInputProps as O, ModalCloseReason as P, ViewOwnerState as Q, ModalSlot as R, TypographySlot as S, TextInputClasses as T, FlexSlot as U, FlexOwnerState as V, FlexThemeConfig as W, ViewBorderWidthToken as X, ViewBorderRadiusToken as Y, ViewColorToken as Z, BackgroundToken as _, ButtonShape as a, SlotProps as at, TypographyOwnerState as b, ButtonThemeConfig as c, AppTheme as d, ViewSlot as et, ComponentConfig as f, ThemeComponents as g, Theme as h, ButtonProps as i, SlotOverride as it, TextInputTextColor as j, TextInputSize as k, ButtonVariant as l, StyleTheme as m, ButtonLoadingPosition as n, configure as nt, ButtonSize as o, StyleOverride as ot, GildTheme as p, ViewBackgroundToken as q, ButtonOwnerState as r, CachePlugin as rt, ButtonSlot as s, ButtonColor as t, ViewThemeConfig as tt, GapToken as u, TextColorToken as v, TypographyVariant as w, TypographyProps as x, TypographyAlign as y, ModalThemeConfig as z };
@@ -0,0 +1,8 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let _umber_style_react_native = require("@umber-style/react-native");
3
+ Object.defineProperty(exports, "Direction", {
4
+ enumerable: true,
5
+ get: function() {
6
+ return _umber_style_react_native.Direction;
7
+ }
8
+ });
@@ -0,0 +1,2 @@
1
+ import { Direction, DirectionProps } from "@umber-style/react-native";
2
+ export { Direction, type DirectionProps };
@@ -0,0 +1,2 @@
1
+ import { Direction, DirectionProps } from "@umber-style/react-native";
2
+ export { Direction, type DirectionProps };
@@ -0,0 +1 @@
1
+ export { Direction } from "@umber-style/react-native";
package/dist/Flex.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { A as FlexOwnerState, M as FlexSlot, N as FlexThemeConfig, P as GapToken, j as FlexProps, k as Flex } from "./themes-DK6h0IiW.cjs";
1
+ import { A as Flex, F as GapToken, M as FlexProps, N as FlexSlot, P as FlexThemeConfig, j as FlexOwnerState } from "./themes-ixg3A3lF.cjs";
2
2
  export { Flex, FlexOwnerState, FlexProps, FlexSlot, FlexThemeConfig, GapToken };
package/dist/Flex.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { B as FlexOwnerState, H as FlexSlot, U as FlexThemeConfig, V as FlexProps, W as GapToken, z as Flex } from "./Button.types-Bb9gBlbS.mjs";
1
+ import { B as Flex, G as GapToken, H as FlexProps, U as FlexSlot, V as FlexOwnerState, W as FlexThemeConfig } from "./Button.types-C8OB0OAz.mjs";
2
2
  export { Flex, FlexOwnerState, FlexProps, FlexSlot, FlexThemeConfig, GapToken };
package/dist/Modal.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as ModalCloseReason, D as ModalSlot, E as ModalScroll, O as ModalThemeConfig, T as ModalProps, w as ModalOwnerState } from "./themes-DK6h0IiW.cjs";
1
+ import { D as ModalScroll, E as ModalProps, O as ModalSlot, T as ModalOwnerState, k as ModalThemeConfig, w as ModalCloseReason } from "./themes-ixg3A3lF.cjs";
2
2
  /**
3
3
  * @description Accessible overlay primitive: the platform's modal, dimmed by a backdrop. It closes on
4
4
  * the back button (`'escapeKey'`) and on a press of the backdrop (`'backdropClick'`).
package/dist/Modal.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { F as ModalProps, I as ModalScroll, L as ModalSlot, N as ModalCloseReason, P as ModalOwnerState, R as ModalThemeConfig } from "./Button.types-Bb9gBlbS.mjs";
1
+ import { F as ModalOwnerState, I as ModalProps, L as ModalScroll, P as ModalCloseReason, R as ModalSlot, z as ModalThemeConfig } from "./Button.types-C8OB0OAz.mjs";
2
2
  /**
3
3
  * @description Accessible overlay primitive: the platform's modal, dimmed by a backdrop. It closes on
4
4
  * the back button (`'escapeKey'`) and on a press of the backdrop (`'backdropClick'`).
@@ -1,3 +1,3 @@
1
- import { S as TextInputVariant, _ as TextInputProps, b as TextInputTextColor, g as TextInputOwnerState, h as TextInputColor, m as TextInputClasses, v as TextInputSize, x as TextInputThemeConfig, y as TextInputSlot } from "./themes-DK6h0IiW.cjs";
1
+ import { C as TextInputVariant, S as TextInputThemeConfig, _ as TextInputOwnerState, b as TextInputSlot, g as TextInputColor, h as TextInputClasses, v as TextInputProps, x as TextInputTextColor, y as TextInputSize } from "./themes-ixg3A3lF.cjs";
2
2
  export declare function TextInput({ autoComplete, autoFocus, borderRadius, color: colorProp, textColor: textColorProp, disabled: disabledProp, error: errorProp, fullWidth: fullWidthProp, id: idProp, inputProps, multiline, onChange, placeholder, readOnly, required: requiredProp, rows, size: sizeProp, type, value, variant: variantProp, style, slotProps, 'data-testid': dataTestid, className: _className, classes: _classes, components: _components, inputComponent: _inputComponent, inputSize: _inputSize, maxRows: _maxRows, minRows: _minRows, resize: _resize, name: _name, ...spaceProps }: Readonly<TextInputProps>): import("react").JSX.Element;
3
3
  export type { TextInputClasses, TextInputColor, TextInputOwnerState, TextInputProps, TextInputSize, TextInputSlot, TextInputTextColor, TextInputThemeConfig, TextInputVariant };
@@ -1,3 +1,3 @@
1
- import { A as TextInputTextColor, D as TextInputProps, E as TextInputOwnerState, M as TextInputVariant, O as TextInputSize, T as TextInputColor, j as TextInputThemeConfig, k as TextInputSlot, w as TextInputClasses } from "./Button.types-Bb9gBlbS.mjs";
1
+ import { A as TextInputSlot, D as TextInputOwnerState, E as TextInputColor, M as TextInputThemeConfig, N as TextInputVariant, O as TextInputProps, T as TextInputClasses, j as TextInputTextColor, k as TextInputSize } from "./Button.types-C8OB0OAz.mjs";
2
2
  export declare function TextInput({ autoComplete, autoFocus, borderRadius, color: colorProp, textColor: textColorProp, disabled: disabledProp, error: errorProp, fullWidth: fullWidthProp, id: idProp, inputProps, multiline, onChange, placeholder, readOnly, required: requiredProp, rows, size: sizeProp, type, value, variant: variantProp, style, slotProps, 'data-testid': dataTestid, className: _className, classes: _classes, components: _components, inputComponent: _inputComponent, inputSize: _inputSize, maxRows: _maxRows, minRows: _minRows, resize: _resize, name: _name, ...spaceProps }: Readonly<TextInputProps>): import("react").JSX.Element;
3
3
  export type { TextInputClasses, TextInputColor, TextInputOwnerState, TextInputProps, TextInputSize, TextInputSlot, TextInputTextColor, TextInputThemeConfig, TextInputVariant };
@@ -1,2 +1,2 @@
1
- import { t as ThemeProvider } from "./index-DcHJkXar.cjs";
1
+ import { t as ThemeProvider } from "./index-D8n6Muaf.cjs";
2
2
  export { ThemeProvider };
@@ -1,2 +1,2 @@
1
- import { t as ThemeProvider } from "./index-BqhozwWy.mjs";
1
+ import { t as ThemeProvider } from "./index-BBalOdfK.mjs";
2
2
  export { ThemeProvider };
@@ -1,3 +1,3 @@
1
- import { c as TypographyAlign, d as TypographySlot, f as TypographyThemeConfig, l as TypographyOwnerState, o as BackgroundToken, p as TypographyVariant, s as TextColorToken, u as TypographyProps } from "./themes-DK6h0IiW.cjs";
1
+ import { c as TextColorToken, d as TypographyProps, f as TypographySlot, l as TypographyAlign, m as TypographyVariant, p as TypographyThemeConfig, s as BackgroundToken, u as TypographyOwnerState } from "./themes-ixg3A3lF.cjs";
2
2
  export declare function Typography({ variant, as, style, className, slotProps, ...rest }: Readonly<TypographyProps>): import("react").JSX.Element;
3
3
  export { BackgroundToken, TextColorToken, TypographyAlign, TypographyOwnerState, TypographyProps, TypographySlot, TypographyThemeConfig, type TypographyVariant };
@@ -1,3 +1,3 @@
1
- import { C as TypographyVariant, S as TypographyThemeConfig, _ as TextColorToken, b as TypographyProps, g as BackgroundToken, v as TypographyAlign, x as TypographySlot, y as TypographyOwnerState } from "./Button.types-Bb9gBlbS.mjs";
1
+ import { C as TypographyThemeConfig, S as TypographySlot, _ as BackgroundToken, b as TypographyOwnerState, v as TextColorToken, w as TypographyVariant, x as TypographyProps, y as TypographyAlign } from "./Button.types-C8OB0OAz.mjs";
2
2
  export declare function Typography({ variant, as, style, className, slotProps, ...rest }: Readonly<TypographyProps>): import("react").JSX.Element;
3
3
  export { BackgroundToken, TextColorToken, TypographyAlign, TypographyOwnerState, TypographyProps, TypographySlot, TypographyThemeConfig, type TypographyVariant };
package/dist/View.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { B as ViewColorToken, F as View, H as ViewProps, I as ViewBackgroundToken, L as ViewBorderColorToken, R as ViewBorderRadiusToken, U as ViewSlot, V as ViewOwnerState, W as ViewThemeConfig, z as ViewBorderWidthToken } from "./themes-DK6h0IiW.cjs";
1
+ import { B as ViewBorderWidthToken, G as ViewThemeConfig, H as ViewOwnerState, I as View, L as ViewBackgroundToken, R as ViewBorderColorToken, U as ViewProps, V as ViewColorToken, W as ViewSlot, z as ViewBorderRadiusToken } from "./themes-ixg3A3lF.cjs";
2
2
  export { View, ViewBackgroundToken, ViewBorderColorToken, ViewBorderRadiusToken, ViewBorderWidthToken, ViewColorToken, ViewOwnerState, ViewProps, ViewSlot, ViewThemeConfig };
package/dist/View.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as ViewSlot, G as View, J as ViewBorderRadiusToken, K as ViewBackgroundToken, Q as ViewProps, X as ViewColorToken, Y as ViewBorderWidthToken, Z as ViewOwnerState, et as ViewThemeConfig, q as ViewBorderColorToken } from "./Button.types-Bb9gBlbS.mjs";
1
+ import { $ as ViewProps, J as ViewBorderColorToken, K as View, Q as ViewOwnerState, X as ViewBorderWidthToken, Y as ViewBorderRadiusToken, Z as ViewColorToken, et as ViewSlot, q as ViewBackgroundToken, tt as ViewThemeConfig } from "./Button.types-C8OB0OAz.mjs";
2
2
  export { View, ViewBackgroundToken, ViewBorderColorToken, ViewBorderRadiusToken, ViewBorderWidthToken, ViewColorToken, ViewOwnerState, ViewProps, ViewSlot, ViewThemeConfig };
@@ -1,4 +1,4 @@
1
- import { p as GildTheme } from "./Button.types-Bb9gBlbS.mjs";
1
+ import { p as GildTheme } from "./Button.types-C8OB0OAz.mjs";
2
2
  import * as GildCore from "@gild-ui/core/theme";
3
3
  type GildFallback = GildCore.Register extends {
4
4
  themes: unknown;
@@ -1,4 +1,4 @@
1
- import { r as GildTheme } from "./themes-DK6h0IiW.cjs";
1
+ import { r as GildTheme } from "./themes-ixg3A3lF.cjs";
2
2
  import * as GildCore from "@gild-ui/core/theme";
3
3
  type GildFallback = GildCore.Register extends {
4
4
  themes: unknown;
package/dist/engine.cjs CHANGED
@@ -1,6 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_phoneTheme = require("./phoneTheme-kvZTk6l5.cjs");
3
3
  let _umber_style_react_native = require("@umber-style/react-native");
4
+ let _umber_style_rtl = require("@umber-style/rtl");
4
5
  // src/engine/configure.ts
5
6
  const lengthKeys = [
6
7
  "space",
@@ -10,10 +11,11 @@ const lengthKeys = [
10
11
  "borderWidths",
11
12
  "letterSpacings"
12
13
  ];
13
- function configure({ serverTheme } = {}) {
14
+ function configure({ serverTheme, plugins } = {}) {
14
15
  (0, _umber_style_react_native.configure)({
15
16
  serverTheme: require_phoneTheme.phoneTheme(serverTheme ?? require_phoneTheme.baseTheme),
16
- lengthKeys
17
+ lengthKeys,
18
+ plugins
17
19
  });
18
20
  }
19
21
  Object.defineProperty(exports, "asIs", {
@@ -29,12 +31,24 @@ Object.defineProperty(exports, "defineTheme", {
29
31
  return _umber_style_react_native.defineTheme;
30
32
  }
31
33
  });
34
+ Object.defineProperty(exports, "dir", {
35
+ enumerable: true,
36
+ get: function() {
37
+ return _umber_style_rtl.dir;
38
+ }
39
+ });
32
40
  Object.defineProperty(exports, "fallback", {
33
41
  enumerable: true,
34
42
  get: function() {
35
43
  return _umber_style_react_native.fallback;
36
44
  }
37
45
  });
46
+ Object.defineProperty(exports, "rtl", {
47
+ enumerable: true,
48
+ get: function() {
49
+ return _umber_style_rtl.rtl;
50
+ }
51
+ });
38
52
  Object.defineProperty(exports, "val", {
39
53
  enumerable: true,
40
54
  get: function() {
package/dist/engine.d.cts CHANGED
@@ -1,9 +1,10 @@
1
- import "./bridge-CH-RnxIe.cjs";
2
- import { i as Theme$1, it as configure$1, r as GildTheme, t as AppTheme } from "./themes-DK6h0IiW.cjs";
1
+ import "./bridge-DkACIVNv.cjs";
2
+ import { a as Theme$1, at as configure$1, ot as CachePlugin, r as GildTheme, t as AppTheme } from "./themes-ixg3A3lF.cjs";
3
3
  import { t as Exact } from "./exact-DOxXx2ZR.cjs";
4
4
  import * as GildCore from "@gild-ui/core/theme";
5
5
  import { Register } from "@gild-ui/core/theme";
6
- import { asIs, defineTheme, fallback, val, variable } from "@umber-style/react-native";
6
+ import { NativeDirection, NativePlugin, NativePlugin as NativePlugin$1, NativePluginContext, asIs, defineTheme, fallback, val, variable } from "@umber-style/react-native";
7
+ import { DirValues, RtlOptions, dir, rtl } from "@umber-style/rtl";
7
8
  type GildFallback = GildCore.Register extends {
8
9
  themes: unknown;
9
10
  } ? Record<never, never> : GildTheme;
@@ -45,22 +46,30 @@ interface ConfigureOwnProps<T> {
45
46
  cache?: EngineOptions['cache'];
46
47
  /** The class prefix. It is the prefix of the cache, which is `soroush` for `styleCache`, so leave it out unless the cache is your own. */
47
48
  prefix?: EngineOptions['prefix'];
49
+ /** What each declaration goes through before it is written, in order: `[rtl()]` writes both directions of a style in one class. None by default. */
50
+ plugins?: readonly CachePlugin[];
48
51
  }
49
52
  /** The options once the app registers its themes: it has no built-in theme to fall back to, so `serverTheme` is required. */
50
53
  interface RegisteredConfigureProps<T> extends Omit<ConfigureOwnProps<T>, 'serverTheme'> {
51
54
  /** The theme of anything with no provider above it: server components, and the first render. */
52
55
  serverTheme: T & Exact<T, AppTheme>;
53
56
  }
54
- type ConfigureOptions<T = Theme$1> = Register extends {
57
+ type ConfigureOptions$1<T = Theme$1> = Register extends {
55
58
  themes: unknown;
56
59
  } ? RegisteredConfigureProps<T> : ConfigureOwnProps<T>;
60
+ /** The options of the web's `configure`, with the plugins of a phone: `rtl()` is one, and so is any plugin that has `native`. */
61
+ type ConfigureOptions<T = Theme$1> = Omit<ConfigureOptions$1<T>, 'plugins'> & {
62
+ /** What each style a styled component resolves goes through, in order: `[rtl()]` flips what the platform does not mirror under `Direction`. None by default. */
63
+ plugins?: readonly NativePlugin$1[];
64
+ };
57
65
  /**
58
66
  * Configures the styling, once for the whole program, in the `setup` module of the app:
59
67
  * `configure({ serverTheme: themes.light })`, the call `@gild-ui/react/engine` takes, so one setup
60
68
  * module runs on the web and on a phone. `serverTheme` is the theme of anything with no provider above
61
- * it. `cache` and `prefix` are accepted and ignored: there is no style sheet to write on a phone.
69
+ * it. `plugins` is the list of plugins of a phone (`rtl()` is one). `cache` and `prefix` are accepted
70
+ * and ignored: there is no style sheet to write on a phone.
62
71
  */
63
72
  export declare function configure<T extends Theme$1 = Theme$1>(...args: Register extends {
64
73
  themes: unknown;
65
74
  } ? [options: Readonly<ConfigureOptions<T>>] : [options?: Readonly<ConfigureOptions<T>>]): void;
66
- export { type ConfigureOptions, asIs, defineTheme, fallback, val, variable };
75
+ export { type ConfigureOptions, type DirValues, type NativeDirection, type NativePlugin, type NativePluginContext, type RtlOptions, asIs, defineTheme, dir, fallback, rtl, val, variable };
package/dist/engine.d.mts CHANGED
@@ -1,9 +1,10 @@
1
- import "./bridge-B_MGN7QY.mjs";
2
- import { d as AppTheme, m as Theme$1, p as GildTheme, tt as configure$2 } from "./Button.types-Bb9gBlbS.mjs";
1
+ import "./bridge-6VWtiuTF.mjs";
2
+ import { d as AppTheme, h as Theme$1, nt as configure$2, p as GildTheme, rt as CachePlugin } from "./Button.types-C8OB0OAz.mjs";
3
3
  import { t as Exact } from "./exact-DOxXx2ZR.mjs";
4
- import { asIs, defineTheme, fallback, val, variable } from "@umber-style/react-native";
4
+ import { NativeDirection, NativePlugin, NativePlugin as NativePlugin$1, NativePluginContext, asIs, defineTheme, fallback, val, variable } from "@umber-style/react-native";
5
5
  import * as GildCore from "@gild-ui/core/theme";
6
6
  import { Register } from "@gild-ui/core/theme";
7
+ import { DirValues, RtlOptions, dir, rtl } from "@umber-style/rtl";
7
8
  type GildFallback = GildCore.Register extends {
8
9
  themes: unknown;
9
10
  } ? Record<never, never> : GildTheme;
@@ -45,22 +46,30 @@ interface ConfigureOwnProps<T> {
45
46
  cache?: EngineOptions['cache'];
46
47
  /** The class prefix. It is the prefix of the cache, which is `soroush` for `styleCache`, so leave it out unless the cache is your own. */
47
48
  prefix?: EngineOptions['prefix'];
49
+ /** What each declaration goes through before it is written, in order: `[rtl()]` writes both directions of a style in one class. None by default. */
50
+ plugins?: readonly CachePlugin[];
48
51
  }
49
52
  /** The options once the app registers its themes: it has no built-in theme to fall back to, so `serverTheme` is required. */
50
53
  interface RegisteredConfigureProps<T> extends Omit<ConfigureOwnProps<T>, 'serverTheme'> {
51
54
  /** The theme of anything with no provider above it: server components, and the first render. */
52
55
  serverTheme: T & Exact<T, AppTheme>;
53
56
  }
54
- type ConfigureOptions<T = Theme$1> = Register extends {
57
+ type ConfigureOptions$1<T = Theme$1> = Register extends {
55
58
  themes: unknown;
56
59
  } ? RegisteredConfigureProps<T> : ConfigureOwnProps<T>;
60
+ /** The options of the web's `configure`, with the plugins of a phone: `rtl()` is one, and so is any plugin that has `native`. */
61
+ type ConfigureOptions<T = Theme$1> = Omit<ConfigureOptions$1<T>, 'plugins'> & {
62
+ /** What each style a styled component resolves goes through, in order: `[rtl()]` flips what the platform does not mirror under `Direction`. None by default. */
63
+ plugins?: readonly NativePlugin$1[];
64
+ };
57
65
  /**
58
66
  * Configures the styling, once for the whole program, in the `setup` module of the app:
59
67
  * `configure({ serverTheme: themes.light })`, the call `@gild-ui/react/engine` takes, so one setup
60
68
  * module runs on the web and on a phone. `serverTheme` is the theme of anything with no provider above
61
- * it. `cache` and `prefix` are accepted and ignored: there is no style sheet to write on a phone.
69
+ * it. `plugins` is the list of plugins of a phone (`rtl()` is one). `cache` and `prefix` are accepted
70
+ * and ignored: there is no style sheet to write on a phone.
62
71
  */
63
72
  export declare function configure<T extends Theme$1 = Theme$1>(...args: Register extends {
64
73
  themes: unknown;
65
74
  } ? [options: Readonly<ConfigureOptions<T>>] : [options?: Readonly<ConfigureOptions<T>>]): void;
66
- export { type ConfigureOptions, asIs, defineTheme, fallback, val, variable };
75
+ export { type ConfigureOptions, type DirValues, type NativeDirection, type NativePlugin, type NativePluginContext, type RtlOptions, asIs, defineTheme, dir, fallback, rtl, val, variable };
package/dist/engine.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import { t as phoneTheme } from "./phoneTheme-RIafDzgw.mjs";
2
2
  import { t as baseTheme } from "./themes-rGHVhV5e.mjs";
3
3
  import { asIs, configure as configure$1, defineTheme, fallback, val, variable } from "@umber-style/react-native";
4
+ import { dir, rtl } from "@umber-style/rtl";
4
5
  // src/engine/configure.ts
5
6
  const lengthKeys = [
6
7
  "space",
@@ -10,10 +11,11 @@ const lengthKeys = [
10
11
  "borderWidths",
11
12
  "letterSpacings"
12
13
  ];
13
- function configure({ serverTheme } = {}) {
14
+ function configure({ serverTheme, plugins } = {}) {
14
15
  configure$1({
15
16
  serverTheme: phoneTheme(serverTheme ?? baseTheme),
16
- lengthKeys
17
+ lengthKeys,
18
+ plugins
17
19
  });
18
20
  }
19
- export { asIs, configure, defineTheme, fallback, val, variable };
21
+ export { asIs, configure, defineTheme, dir, fallback, rtl, val, variable };
@@ -1,5 +1,5 @@
1
- import "./bridge-B_MGN7QY.mjs";
2
- import { d as AppTheme, m as Theme$1 } from "./Button.types-Bb9gBlbS.mjs";
1
+ import "./bridge-6VWtiuTF.mjs";
2
+ import { d as AppTheme, h as Theme$1 } from "./Button.types-C8OB0OAz.mjs";
3
3
  import { t as Exact } from "./exact-DOxXx2ZR.mjs";
4
4
  import { Register, ThemeDefaults } from "@gild-ui/core/theme";
5
5
  import { ReactElement, ReactNode } from "react";
@@ -1,5 +1,5 @@
1
- import "./bridge-CH-RnxIe.cjs";
2
- import { i as Theme$1, t as AppTheme } from "./themes-DK6h0IiW.cjs";
1
+ import "./bridge-DkACIVNv.cjs";
2
+ import { a as Theme$1, t as AppTheme } from "./themes-ixg3A3lF.cjs";
3
3
  import { t as Exact } from "./exact-DOxXx2ZR.cjs";
4
4
  import { Register, ThemeDefaults } from "@gild-ui/core/theme";
5
5
  import { ReactElement, ReactNode } from "react";
package/dist/index.cjs CHANGED
@@ -1,8 +1,15 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_ThemeProvider = require("./ThemeProvider-CsfZi16_.cjs");
3
3
  require("./useTheme.cjs");
4
+ require("./Direction.cjs");
4
5
  const require_useDefaultProps = require("./useDefaultProps-DzaUOADT.cjs");
5
6
  let _umber_style_react_native = require("@umber-style/react-native");
7
+ Object.defineProperty(exports, "Direction", {
8
+ enumerable: true,
9
+ get: function() {
10
+ return _umber_style_react_native.Direction;
11
+ }
12
+ });
6
13
  Object.defineProperty(exports, "StyleSheet", {
7
14
  enumerable: true,
8
15
  get: function() {
package/dist/index.d.cts CHANGED
@@ -1,6 +1,7 @@
1
- import { t as ThemeProvider } from "./index-DcHJkXar.cjs";
1
+ import { t as ThemeProvider } from "./index-D8n6Muaf.cjs";
2
2
  import { useTheme } from "./useTheme.cjs";
3
- import { a as ThemeComponents, n as ComponentConfig, nt as SlotProps, rt as StyleOverride, tt as SlotOverride } from "./themes-DK6h0IiW.cjs";
3
+ import { Direction, DirectionProps } from "./Direction.cjs";
4
+ import { i as StyleTheme, it as StyleOverride, n as ComponentConfig, nt as SlotOverride, o as ThemeComponents, rt as SlotProps } from "./themes-ixg3A3lF.cjs";
4
5
  import { StyleSheet, alpha, css, keyframes, negate, useMediaQuery, useStyle, withStyle, withTheme } from "@umber-style/react-native";
5
6
  type DefaultPropsOf<N extends keyof ThemeComponents> = Partial<NonNullable<NonNullable<ThemeComponents[N]>['$owner']>>;
6
7
  /**
@@ -11,4 +12,4 @@ type DefaultPropsOf<N extends keyof ThemeComponents> = Partial<NonNullable<NonNu
11
12
  * explicit prop → group context → `useDefaultProps` → `theme.defaults.*` → literal fallback.
12
13
  */
13
14
  export declare function useDefaultProps<N extends keyof ThemeComponents>(name: N): DefaultPropsOf<N>;
14
- export { type ComponentConfig, type SlotOverride, type SlotProps, type StyleOverride, StyleSheet, type ThemeComponents, ThemeProvider, alpha, css, keyframes, negate, useMediaQuery, useStyle, useTheme, withStyle, withTheme };
15
+ export { type ComponentConfig, Direction, type DirectionProps, type SlotOverride, type SlotProps, type StyleOverride, StyleSheet, type StyleTheme, type ThemeComponents, ThemeProvider, alpha, css, keyframes, negate, useMediaQuery, useStyle, useTheme, withStyle, withTheme };
package/dist/index.d.mts CHANGED
@@ -1,6 +1,7 @@
1
- import { t as ThemeProvider } from "./index-BqhozwWy.mjs";
1
+ import { t as ThemeProvider } from "./index-BBalOdfK.mjs";
2
2
  import { useTheme } from "./useTheme.mjs";
3
- import { f as ComponentConfig, h as ThemeComponents, it as StyleOverride, nt as SlotOverride, rt as SlotProps } from "./Button.types-Bb9gBlbS.mjs";
3
+ import { Direction, DirectionProps } from "./Direction.mjs";
4
+ import { at as SlotProps, f as ComponentConfig, g as ThemeComponents, it as SlotOverride, m as StyleTheme, ot as StyleOverride } from "./Button.types-C8OB0OAz.mjs";
4
5
  import { StyleSheet, alpha, css, keyframes, negate, useMediaQuery, useStyle, withStyle, withTheme } from "@umber-style/react-native";
5
6
  type DefaultPropsOf<N extends keyof ThemeComponents> = Partial<NonNullable<NonNullable<ThemeComponents[N]>['$owner']>>;
6
7
  /**
@@ -11,4 +12,4 @@ type DefaultPropsOf<N extends keyof ThemeComponents> = Partial<NonNullable<NonNu
11
12
  * explicit prop → group context → `useDefaultProps` → `theme.defaults.*` → literal fallback.
12
13
  */
13
14
  export declare function useDefaultProps<N extends keyof ThemeComponents>(name: N): DefaultPropsOf<N>;
14
- export { type ComponentConfig, type SlotOverride, type SlotProps, type StyleOverride, StyleSheet, type ThemeComponents, ThemeProvider, alpha, css, keyframes, negate, useMediaQuery, useStyle, useTheme, withStyle, withTheme };
15
+ export { type ComponentConfig, Direction, type DirectionProps, type SlotOverride, type SlotProps, type StyleOverride, StyleSheet, type StyleTheme, type ThemeComponents, ThemeProvider, alpha, css, keyframes, negate, useMediaQuery, useStyle, useTheme, withStyle, withTheme };
package/dist/index.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  import { t as ThemeProvider } from "./ThemeProvider-BgTIjOfL.mjs";
2
2
  import { useTheme } from "./useTheme.mjs";
3
+ import { Direction } from "./Direction.mjs";
3
4
  import { t as useDefaultProps } from "./useDefaultProps-1josiKIp.mjs";
4
5
  import { StyleSheet, alpha, css, keyframes, negate, useMediaQuery, useStyle, withStyle, withTheme } from "@umber-style/react-native";
5
- export { StyleSheet, ThemeProvider, alpha, css, keyframes, negate, useDefaultProps, useMediaQuery, useStyle, useTheme, withStyle, withTheme };
6
+ export { Direction, StyleSheet, ThemeProvider, alpha, css, keyframes, negate, useDefaultProps, useMediaQuery, useStyle, useTheme, withStyle, withTheme };
@@ -1,20 +1,8 @@
1
1
  import { ButtonVariants, InputVariantKey, OpenScale, Register as Register$1, RegisteredTheme, Theme as Theme$1, ThemeBackground, ThemeColor, ThemeFonts, ThemeRadii, ThemeSize, ThemeSpaceKey, ThemeText, ThemeTransitionEasing, ThemeTypography, ThemeZOrder, TypographyVariant, VariantOf } from "@gild-ui/core/theme";
2
+ import { BindingOptions as BindingOptions$1, CSSObject as CSSObject$1, CachePlugin, CachePlugin as CachePlugin$1, ColorScheme as ColorScheme$1, CssArgument as CssArgument$1, GlobalInput as GlobalInput$1, Interpolation as Interpolation$1, InterpolationResult as InterpolationResult$1, PropsTaking as PropsTaking$1, SerializedStyles as SerializedStyles$1, SheetEntry as SheetEntry$1, SheetStyles as SheetStyles$1, StaticTemplateValue as StaticTemplateValue$1, StyleInput as StyleInput$1, StyleTypeOptions as StyleTypeOptions$1, StylerOptions as StylerOptions$1, TemplateValue as TemplateValue$1, Theme as Theme$3, ThemeInput as ThemeInput$1, ThemeRefs, ThemeRefs as ThemeRefs$1, ThemedEntry as ThemedEntry$1, WebStyleObject as WebStyleObject$1, WrapperOwnStatics as WrapperOwnStatics$1 } from "@umber-style/core";
2
3
  import { ButtonHTMLAttributes, CSSProperties, ChangeEventHandler, ComponentProps, ComponentPropsWithRef, ComponentType, ElementType, FunctionComponent, HTMLAttributes, InputHTMLAttributes, JSX, ReactNode, TextareaHTMLAttributes } from "react";
3
- import { BindingOptions as BindingOptions$1, CSSObject as CSSObject$1, ColorScheme as ColorScheme$1, CssArgument as CssArgument$1, GlobalInput as GlobalInput$1, Interpolation as Interpolation$1, InterpolationResult as InterpolationResult$1, PropsTaking as PropsTaking$1, SerializedStyles as SerializedStyles$1, SheetEntry as SheetEntry$1, SheetStyles as SheetStyles$1, StaticTemplateValue as StaticTemplateValue$1, StyleInput as StyleInput$1, StyleTypeOptions as StyleTypeOptions$1, StylerOptions as StylerOptions$1, TemplateValue as TemplateValue$1, Theme as Theme$3, ThemeInput as ThemeInput$1, ThemedEntry as ThemedEntry$1, WebStyleObject as WebStyleObject$1, WrapperOwnStatics as WrapperOwnStatics$1 } from "@umber-style/core";
4
4
  import { BorderProps, FlexboxProps, LayoutFrameProps, LayoutProps, PositionProps, SpaceProps, SpanProps, TypographyProps as TypographyProps$1 } from "@soroush.tech/styled-system";
5
5
  import { SheetStyleProp } from "@umber-style/react-native";
6
- /** What only the client build of the React binding takes: it can render the style of its classes on a server. */
7
- interface ServerStyleOptions {
8
- /**
9
- * Whether, where there is no `document` (the server render of a client component), a styled element and a
10
- * theme provider render the `<style href precedence>` elements of their classes, as the server components
11
- * build does. React moves them to the head and renders each `href` once, so the first HTML of a page
12
- * is styled whichever build rendered a component. In the browser the client build inserts into its sheet
13
- * and renders none, whatever this is. Default true. Set it to false when a classic server render
14
- * puts the CSS of the page into one style element of its own (`extractPageStyles`, `createStyleTag`).
15
- */
16
- hasServerStyleElements?: boolean;
17
- }
18
6
  /**
19
7
  * The theme of the default style of this binding: what `styled`, `useTheme`, `StyleSheet` and
20
8
  * `ThemeProvider` of the default style read. It extends the core's `Theme`, so an app gives it members
@@ -30,7 +18,73 @@ interface Theme$2 extends Theme$3 {
30
18
  * of the props and the theme, nothing, or a list of them. The core's `Interpolation`, with this binding's
31
19
  * `Theme` unless another is given.
32
20
  */
33
- type Interpolation<Props = unknown, T = Theme$2> = Interpolation$1<Props, T>;
21
+ type Interpolation<Props = unknown, T = ThemeRefs$1<Theme$2>> = Interpolation$1<Props, T>;
22
+ /**
23
+ * What the `theme` of a provider of the theme `T` takes: `ThemeInput<T>`. The `Theme` of the default style
24
+ * has no member of its own until an app declares its members in it, and until then no theme of the app
25
+ * would match it (TypeScript rejects an object that shares no member with a type whose members are all
26
+ * optional); so while it has none, the provider takes any theme object, or a function of the theme above
27
+ * whose parameter the app types (`(outer: AppTheme) => AppTheme`).
28
+ */
29
+ type ProviderThemeInput<T> = [Exclude<keyof T, '_theme'>] extends [never] ? object | UntypedThemeFunction['derive'] : ThemeInput$1<T>;
30
+ /**
31
+ * The function form of `ProviderThemeInput` for a theme with no members: its parameter is compared both
32
+ * ways, as a method's is, so a function whose parameter the app types as its own theme is taken.
33
+ */
34
+ interface UntypedThemeFunction {
35
+ derive(outer: object): object;
36
+ }
37
+ /** The props of `ThemeProvider`: the theme of the subtree, and on the web its color scheme and wrapper. */
38
+ interface ThemeProviderProps<T> {
39
+ /**
40
+ * The theme, or the part of it that this subtree changes; or a function of the theme above (the base
41
+ * theme, or an empty object, for the outermost provider) that returns it. It is merged over the theme above.
42
+ */
43
+ readonly theme: ProviderThemeInput<T>;
44
+ /** Web only. */
45
+ readonly colorScheme?: ColorScheme$1;
46
+ /** Web only: a class of the wrapper of a nested provider. */
47
+ readonly className?: string;
48
+ /**
49
+ * Web only. Renders no element, no class and no rule: the app puts `themeClass(theme)` on an ancestor,
50
+ * usually `<html>`. The theme still reaches the engine and the context. Without it the outermost provider
51
+ * declares its theme on `:root`, and renders no element either.
52
+ */
53
+ readonly isRoot?: boolean;
54
+ /** The subtree that the theme applies to. */
55
+ readonly children?: ReactNode;
56
+ }
57
+ /** The props of `ThemeScope`. */
58
+ interface ThemeScopeProps {
59
+ /** The content to wrap in the wrapper of the nearest nested provider: what a portal renders elsewhere. */
60
+ readonly children?: ReactNode;
61
+ }
62
+ /** The props of `Global`. */
63
+ interface GlobalProps<T> {
64
+ /**
65
+ * The global styles: a handle that `globalStyles` made, a style object, a function of the theme, or a
66
+ * list of them, written in the order of the list. A function of the theme reads the nearest provider:
67
+ * tokens are references, raw keys (`breakpoints`) are its real values.
68
+ */
69
+ readonly styles: GlobalInput$1<T>;
70
+ }
71
+ /** The props of `ThemeProvider` on the web: those of every platform, and the element of the wrapper. */
72
+ interface WebThemeProviderProps<T> extends ThemeProviderProps<T> {
73
+ /** The element of the wrapper of a nested provider. Default 'div'. */
74
+ readonly as?: string;
75
+ }
76
+ /** What only the client build of the React binding takes: it can render the style of its classes on a server. */
77
+ interface ServerStyleOptions {
78
+ /**
79
+ * Whether, where there is no `document` (the server render of a client component), a styled element and a
80
+ * theme provider render the `<style href precedence>` elements of their classes, as the server components
81
+ * build does. React moves them to the head and renders each `href` once, so the first HTML of a page
82
+ * is styled whichever build rendered a component. In the browser the client build inserts into its sheet
83
+ * and renders none, whatever this is. Default true. Set it to false when a classic server render
84
+ * puts the CSS of the page into one style element of its own (`extractPageStyles`, `createStyleTag`).
85
+ */
86
+ hasServerStyleElements?: boolean;
87
+ }
34
88
  /**
35
89
  * The options of `configure()`: those of `StyleOptions` for the engine of the default style, and the
36
90
  * theme of anything with no provider. Call it once for the program, in a `setup` module that runs on the
@@ -52,6 +106,14 @@ interface DefaultStyleOptions extends BindingOptions$1<Theme$2>, ServerStyleOpti
52
106
  * @deprecated The same as `serverTheme`, which is its name now.
53
107
  */
54
108
  theme?: Theme$2;
109
+ /**
110
+ * What each declaration of the default style goes through before it is written, in order: in the cache it
111
+ * makes, a cache it is given and the cache of a `CacheProvider`, in client and server components. A plugin
112
+ * keeps a declaration, changes it, replaces it with several, or puts them under a condition of the rule's
113
+ * selector (`rtl()` of `@umber-style/rtl`). Set only here; their names are part of the stamp of the cache
114
+ * that the default style makes. Default none: the output is the same as without the option.
115
+ */
116
+ plugins?: readonly CachePlugin$1[];
55
117
  }
56
118
  /**
57
119
  * The options of `styled(tag, options)`: the label of the class, which props reach the element, and a class
@@ -149,7 +211,7 @@ type ElementProps<ComponentProps extends object, SpecificComponentProps extends
149
211
  * The props of the component's own are a type argument, `AdditionalProps`. A function style reads all of
150
212
  * them, the component's own over the others, and `theme`, the theme `T`.
151
213
  */
152
- interface CreateStyledComponent<ComponentProps extends object, SpecificComponentProps extends object = object, JSXProps extends object = object, T = Theme$2> {
214
+ interface CreateStyledComponent<ComponentProps extends object, SpecificComponentProps extends object = object, JSXProps extends object = object, T = ThemeRefs$1<Theme$2>> {
153
215
  <AdditionalProps extends object = object>(style: (props: StyleFunctionProps<ComponentProps & SpecificComponentProps, AdditionalProps> & {
154
216
  theme: T;
155
217
  }) => InterpolationResult$1, ...styles: Interpolation<StyleFunctionProps<ComponentProps & SpecificComponentProps, AdditionalProps>, T>[]): StyledComponent<ElementType, AdditionalProps, ElementProps<ComponentProps, SpecificComponentProps, JSXProps>>;
@@ -183,60 +245,6 @@ interface SheetDefinition<S extends SheetStyles$1, E> {
183
245
  /** Never set at run time: it only carries the types. */
184
246
  readonly entries?: { [K in keyof S]: E; };
185
247
  }
186
- /**
187
- * What the `theme` of a provider of the theme `T` takes: `ThemeInput<T>`. The `Theme` of the default style
188
- * has no member of its own until an app declares its members in it, and until then no theme of the app
189
- * would match it (TypeScript rejects an object that shares no member with a type whose members are all
190
- * optional); so while it has none, the provider takes any theme object, or a function of the theme above
191
- * whose parameter the app types (`(outer: AppTheme) => AppTheme`).
192
- */
193
- type ProviderThemeInput<T> = [Exclude<keyof T, '_theme'>] extends [never] ? object | UntypedThemeFunction['derive'] : ThemeInput$1<T>;
194
- /**
195
- * The function form of `ProviderThemeInput` for a theme with no members: its parameter is compared both
196
- * ways, as a method's is, so a function whose parameter the app types as its own theme is taken.
197
- */
198
- interface UntypedThemeFunction {
199
- derive(outer: object): object;
200
- }
201
- /** The props of `ThemeProvider`: the theme of the subtree, and on the web its color scheme and wrapper. */
202
- interface ThemeProviderProps<T> {
203
- /**
204
- * The theme, or the part of it that this subtree changes; or a function of the theme above (the base
205
- * theme, or an empty object, for the outermost provider) that returns it. It is merged over the theme above.
206
- */
207
- readonly theme: ProviderThemeInput<T>;
208
- /** Web only. */
209
- readonly colorScheme?: ColorScheme$1;
210
- /** Web only: a class of the wrapper of a nested provider. */
211
- readonly className?: string;
212
- /**
213
- * Web only. Renders no element, no class and no rule: the app puts `themeClass(theme)` on an ancestor,
214
- * usually `<html>`. The theme still reaches the engine and the context. Without it the outermost provider
215
- * declares its theme on `:root`, and renders no element either.
216
- */
217
- readonly isRoot?: boolean;
218
- /** The subtree that the theme applies to. */
219
- readonly children?: ReactNode;
220
- }
221
- /** The props of `ThemeScope`. */
222
- interface ThemeScopeProps {
223
- /** The content to wrap in the wrapper of the nearest nested provider: what a portal renders elsewhere. */
224
- readonly children?: ReactNode;
225
- }
226
- /** The props of `Global`. */
227
- interface GlobalProps<T> {
228
- /**
229
- * The global styles: a handle that `globalStyles` made, a style object, a function of the theme, or a
230
- * list of them, written in the order of the list. A function of the theme reads the nearest provider:
231
- * tokens are references, raw keys (`breakpoints`) are its real values.
232
- */
233
- readonly styles: GlobalInput$1<T>;
234
- }
235
- /** The props of `ThemeProvider` on the web: those of every platform, and the element of the wrapper. */
236
- interface WebThemeProviderProps<T> extends ThemeProviderProps<T> {
237
- /** The element of the wrapper of a nested provider. Default 'div'. */
238
- readonly as?: string;
239
- }
240
248
  /**
241
249
  * A component that `withTheme` or `withStyle` made from the component `C`: it takes the props of `C` and
242
250
  * its `ref` (the instance of a class component), without `Name` (`theme` or `styles`), which it gives
@@ -250,9 +258,9 @@ type WrappedComponent<C extends ElementType, Name extends string> = FunctionComp
250
258
  type StyleWrapper<Styles> = <C extends ComponentType<PropsTaking$1<ComponentProps<C>, 'styles', Styles>>>(component: C) => WrappedComponent<C, 'styles'>;
251
259
  /** The setter of `useStyleValue`: a new number, or a function of the number before. */
252
260
  type StyleValueSetter = (next: number | ((previous: number) => number)) => void;
253
- declare const configure: (options: DefaultStyleOptions) => void, getEngine: () => import("@umber-style/core").Engine<Theme$2>, styled: Styled<Theme$2>, StyleSheet: {
261
+ declare const configure: (options: DefaultStyleOptions) => void, getEngine: () => import("@umber-style/core").Engine<Theme$2>, styled: Styled<import("@umber-style/core").ThemeRefs<Theme$2>>, StyleSheet: {
254
262
  create<K extends string>(styles: import("@umber-style/core").ObjectSheet<K>): { readonly [P in K]: import("@umber-style/core").SheetEntry; };
255
- create<K extends string>(styles: (theme: Theme$2) => Record<K, import("@umber-style/core").WebStyleObject>): SheetDefinition<Record<K, import("@umber-style/core").WebStyleObject>, import("@umber-style/core").SheetEntry> & import("@umber-style/core").ThemedEntries<K>;
263
+ create<K extends string>(styles: (theme: NoInfer<import("@umber-style/core").ThemeRefs<Theme$2>>) => Record<K, import("@umber-style/core").WebStyleObject>): SheetDefinition<Record<K, import("@umber-style/core").WebStyleObject>, import("@umber-style/core").SheetEntry> & import("@umber-style/core").ThemedEntries<K>;
256
264
  }, useStyle: {
257
265
  <K extends string>(sheet: { readonly [P in K]: import("@umber-style/core").SheetEntry; }): { readonly [P in K]: import("@umber-style/core").SheetEntry; };
258
266
  <K extends string>(sheet: SheetDefinition<Record<K, import("@umber-style/core").WebStyleObject>, import("@umber-style/core").SheetEntry> & import("@umber-style/core").ThemedEntries<K>): { [P in K]: import("@umber-style/core").SheetEntry; };
@@ -261,17 +269,17 @@ declare const configure: (options: DefaultStyleOptions) => void, getEngine: () =
261
269
  <K extends string>(sheet: { readonly [P in K]: import("@umber-style/core").SheetEntry; }): StyleWrapper<{ readonly [P in K]: import("@umber-style/core").SheetEntry; }>;
262
270
  <K extends string>(sheet: SheetDefinition<Record<K, import("@umber-style/core").WebStyleObject>, import("@umber-style/core").SheetEntry> & import("@umber-style/core").ThemedEntries<K>): StyleWrapper<{ [P in K]: import("@umber-style/core").SheetEntry; }>;
263
271
  <S extends import("@umber-style/core").SheetStyles>(sheet: SheetDefinition<S, import("@umber-style/core").SheetEntry>): StyleWrapper<{ [K in keyof S]: import("@umber-style/core").SheetEntry; }>;
264
- }, useStyleValue: (initial: number, unit?: string) => [import("@umber-style/core").LiveValue, StyleValueSetter], useTheme: () => Theme$2, withTheme: <C extends import("react").ComponentType<import("@umber-style/core").PropsTaking<import("react").ComponentProps<C>, 'theme', Theme$2>>>(component: C) => WrappedComponent<C, "theme">, ThemeProvider: (props: WebThemeProviderProps<Theme$2>) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>, ThemeScope: (props: ThemeScopeProps) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>, useThemeClass: () => string | undefined, ThemeContext: import("react").Context<Theme$2 | undefined>, apply: (...entries: (import("@umber-style/core").SheetEntry | string | null | undefined | false)[]) => {
272
+ }, useStyleValue: (initial: number, unit?: string) => [import("@umber-style/core").LiveValue, StyleValueSetter], useTheme: () => Theme$2, withTheme: <C extends import("react").ComponentType<import("@umber-style/core").PropsTaking<import("react").ComponentProps<C>, 'theme', Theme$2>>>(component: C) => WrappedComponent<C, "theme">, ThemeProvider: (props: WebThemeProviderProps<Theme$2>) => import("react").ReactElement, ThemeScope: (props: ThemeScopeProps) => import("react").ReactElement, useThemeClass: () => string | undefined, ThemeContext: import("react").Context<Theme$2 | undefined>, apply: (...entries: (import("@umber-style/core").SheetEntry | string | null | undefined | false)[]) => {
265
273
  className?: string;
266
274
  }, css: CssFunction, themeClass: (theme: import("@umber-style/core").DeepPartialObject<Theme$2>, colorScheme?: import("@umber-style/core").ColorScheme) => string, when: (theme: import("@umber-style/core").DeepPartialObject<Theme$2>, colorScheme?: import("@umber-style/core").ColorScheme) => import("@umber-style/core").ThemeKey, whenScheme: (scheme: import("@umber-style/core").SchemeName) => import("@umber-style/core").SchemeKey, keyframes: {
267
- (steps: (theme: Theme$2) => import("@umber-style/core").KeyframesSteps, options?: import("@umber-style/core").KeyframesOptions): import("@umber-style/core").Keyframes;
268
- (template: TemplateStringsArray, ...values: import("@umber-style/core").TemplateValue<unknown, Theme$2>[]): import("@umber-style/core").Keyframes;
269
- (steps: import("@umber-style/core").KeyframesInput<Theme$2>, options?: import("@umber-style/core").KeyframesOptions): import("@umber-style/core").Keyframes;
275
+ (steps: (theme: NoInfer<import("@umber-style/core").ThemeRefs<Theme$2>>) => import("@umber-style/core").KeyframesSteps, options?: import("@umber-style/core").KeyframesOptions): import("@umber-style/core").Keyframes;
276
+ (template: TemplateStringsArray, ...values: import("@umber-style/core").TemplateValue<unknown, NoInfer<import("@umber-style/core").ThemeRefs<Theme$2>>>[]): import("@umber-style/core").Keyframes;
277
+ (steps: import("@umber-style/core").KeyframesInput<NoInfer<import("@umber-style/core").ThemeRefs<Theme$2>>>, options?: import("@umber-style/core").KeyframesOptions): import("@umber-style/core").Keyframes;
270
278
  }, globalStyles: {
271
- (styles: (theme: Theme$2) => import("@umber-style/core").GlobalStyleObject): import("@umber-style/core").GlobalStyles<Theme$2>;
272
- (template: TemplateStringsArray, ...values: import("@umber-style/core").TemplateValue<unknown, Theme$2>[]): import("@umber-style/core").GlobalStyles<Theme$2>;
273
- (styles: import("@umber-style/core").GlobalStylesInput<Theme$2>): import("@umber-style/core").GlobalStyles<Theme$2>;
274
- }, Global: (props: GlobalProps<Theme$2>) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | null;
279
+ (styles: (theme: NoInfer<import("@umber-style/core").ThemeRefs<Theme$2>>) => import("@umber-style/core").GlobalStyleObject): import("@umber-style/core").GlobalStyles<NoInfer<import("@umber-style/core").ThemeRefs<Theme$2>>>;
280
+ (template: TemplateStringsArray, ...values: import("@umber-style/core").TemplateValue<unknown, NoInfer<import("@umber-style/core").ThemeRefs<Theme$2>>>[]): import("@umber-style/core").GlobalStyles<NoInfer<import("@umber-style/core").ThemeRefs<Theme$2>>>;
281
+ (styles: import("@umber-style/core").GlobalStylesInput<NoInfer<import("@umber-style/core").ThemeRefs<Theme$2>>>): import("@umber-style/core").GlobalStyles<NoInfer<import("@umber-style/core").ThemeRefs<Theme$2>>>;
282
+ }, Global: (props: GlobalProps<NoInfer<import("@umber-style/core").ThemeRefs<Theme$2>>>) => import("react").ReactElement | null;
275
283
  /** The defaults a theme may set for every `Accordion`. */
276
284
  interface AccordionOwnerState {
277
285
  hasGutters?: boolean;
@@ -590,7 +598,6 @@ type ViewSlot = 'root';
590
598
  /** What `theme.components.View` takes. */
591
599
  type ViewThemeConfig = ComponentConfig<ViewOwnerState, ViewSlot>;
592
600
  declare const View: StrictStyled<StyledComponent<import("react").ElementType, ViewProps, {
593
- theme?: AppTheme;
594
601
  as?: React.ElementType;
595
602
  } & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & object>>;
596
603
  /** Valid values for the gap prop - derived from theme.space keys. */
@@ -608,7 +615,6 @@ type FlexSlot = 'root';
608
615
  /** What `theme.components.Flex` takes. */
609
616
  type FlexThemeConfig = ComponentConfig<FlexOwnerState, FlexSlot>;
610
617
  declare const Flex: StrictStyled<StyledComponent<import("react").ElementType, FlexProps, Omit<Omit<{
611
- theme?: AppTheme;
612
618
  as?: React.ElementType;
613
619
  } & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & object, "as" | keyof ViewProps> & Omit<ViewProps, "style"> & {
614
620
  as?: "a" | "abbr" | "address" | "animate" | "animateMotion" | "animateTransform" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "center" | "circle" | "cite" | "clipPath" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "defs" | "del" | "desc" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "ellipse" | "em" | "embed" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "fieldset" | "figcaption" | "figure" | "filter" | "footer" | "foreignObject" | "form" | "g" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "image" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "line" | "linearGradient" | "link" | "main" | "map" | "mark" | "marker" | "mask" | "menu" | "menuitem" | "meta" | "metadata" | "meter" | "mpath" | "nav" | "noindex" | "noscript" | "object" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "path" | "pattern" | "picture" | "polygon" | "polyline" | "pre" | "progress" | "q" | "radialGradient" | "rect" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "search" | "section" | "select" | "set" | "slot" | "small" | "source" | "span" | "stop" | "strong" | "style" | "sub" | "summary" | "sup" | "svg" | "switch" | "symbol" | "table" | "tbody" | "td" | "template" | "text" | "textPath" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "tspan" | "u" | "ul" | "use" | "var" | "video" | "view" | "wbr" | "webview" | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
@@ -616,8 +622,6 @@ declare const Flex: StrictStyled<StyledComponent<import("react").ElementType, Fl
616
622
  }, "slotProps" | "style"> & {
617
623
  style?: StyleOverride;
618
624
  slotProps?: SlotProps<'root'>;
619
- } & {
620
- theme?: AppTheme;
621
625
  } & object>>;
622
626
  type PaperElevation = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24;
623
627
  /** The defaults a theme may set for every `Menu`. */
@@ -1399,4 +1403,22 @@ interface Theme extends Theme$1 {
1399
1403
  type GildTheme = Theme;
1400
1404
  /** The theme the app registered (see `Register` in the core), or this package's `Theme` when it registered none. */
1401
1405
  type AppTheme = RegisteredTheme<Theme>;
1402
- export { ButtonVariant as $, FlexOwnerState as A, ViewColorToken as B, ModalCloseReason as C, ModalSlot as D, ModalScroll as E, View as F, ButtonColor as G, ViewProps as H, ViewBackgroundToken as I, ButtonProps as J, ButtonLoadingPosition as K, ViewBorderColorToken as L, FlexSlot as M, FlexThemeConfig as N, ModalThemeConfig as O, GapToken as P, ButtonThemeConfig as Q, ViewBorderRadiusToken as R, TextInputVariant as S, ModalProps as T, ViewSlot as U, ViewOwnerState as V, ViewThemeConfig as W, ButtonSize as X, ButtonShape as Y, ButtonSlot as Z, TextInputProps as _, ThemeComponents as a, TextInputTextColor as b, TypographyAlign as c, TypographySlot as d, GapToken$1 as et, TypographyThemeConfig as f, TextInputOwnerState as g, TextInputColor as h, Theme as i, configure as it, FlexProps as j, Flex as k, TypographyOwnerState as l, TextInputClasses as m, ComponentConfig as n, SlotProps as nt, BackgroundToken as o, TypographyVariant as p, ButtonOwnerState as q, GildTheme as r, StyleOverride as rt, TextColorToken as s, AppTheme as t, SlotOverride as tt, TypographyProps as u, TextInputSize as v, ModalOwnerState as w, TextInputThemeConfig as x, TextInputSlot as y, ViewBorderWidthToken as z };
1406
+ /** The parts of the theme that a style function reads as they are: the same ones `baseTheme` marks with `asIs`. */
1407
+ interface StyleThemeModes {
1408
+ readonly $modes: {
1409
+ readonly defaults: 'asIs';
1410
+ readonly typography: 'asIs';
1411
+ readonly sizes: 'asIs';
1412
+ readonly layout: 'asIs';
1413
+ readonly transitions: 'asIs';
1414
+ };
1415
+ }
1416
+ /**
1417
+ * The theme a style function is given (`styled`, `StyleSheet.create`, `keyframes`, `Global`): each token
1418
+ * is the CSS variable that holds it, and the parts that are not CSS values (`sizes`, `typography`,
1419
+ * `layout`, `transitions`, `breakpoints`, `components`, `defaults`) are what they are. A function given to
1420
+ * `Global`, `StyleSheet.create` or `keyframes` (the engine's own, with no modes of the theme) is given
1421
+ * `EngineStyleTheme`.
1422
+ */
1423
+ type StyleTheme = ThemeRefs<AppTheme & StyleThemeModes>;
1424
+ export { ButtonThemeConfig as $, Flex as A, ViewBorderWidthToken as B, TextInputVariant as C, ModalScroll as D, ModalProps as E, GapToken as F, ViewThemeConfig as G, ViewOwnerState as H, View as I, ButtonOwnerState as J, ButtonColor as K, ViewBackgroundToken as L, FlexProps as M, FlexSlot as N, ModalSlot as O, FlexThemeConfig as P, ButtonSlot as Q, ViewBorderColorToken as R, TextInputThemeConfig as S, ModalOwnerState as T, ViewProps as U, ViewColorToken as V, ViewSlot as W, ButtonShape as X, ButtonProps as Y, ButtonSize as Z, TextInputOwnerState as _, Theme as a, configure as at, TextInputSlot as b, TextColorToken as c, TypographyProps as d, ButtonVariant as et, TypographySlot as f, TextInputColor as g, TextInputClasses as h, StyleTheme as i, StyleOverride as it, FlexOwnerState as j, ModalThemeConfig as k, TypographyAlign as l, TypographyVariant as m, ComponentConfig as n, SlotOverride as nt, ThemeComponents as o, CachePlugin as ot, TypographyThemeConfig as p, ButtonLoadingPosition as q, GildTheme as r, SlotProps as rt, BackgroundToken as s, AppTheme as t, GapToken$1 as tt, TypographyOwnerState as u, TextInputProps as v, ModalCloseReason as w, TextInputTextColor as x, TextInputSize as y, ViewBorderRadiusToken as z };
@@ -1,3 +1,3 @@
1
- import "./bridge-CH-RnxIe.cjs";
1
+ import "./bridge-DkACIVNv.cjs";
2
2
  import { useTheme } from "@umber-style/react-native";
3
3
  export { useTheme };
@@ -1,3 +1,3 @@
1
- import "./bridge-B_MGN7QY.mjs";
1
+ import "./bridge-6VWtiuTF.mjs";
2
2
  import { useTheme } from "@umber-style/react-native";
3
3
  export { useTheme };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gild-ui/react-native",
3
- "version": "0.1.0-alpha.1",
3
+ "version": "0.1.0-alpha.2",
4
4
  "description": "Gild UI for React Native: the same components, props and themes as @gild-ui/react, drawn with the platform views of iOS and Android - ThemeProvider, useTheme, View, Flex, Typography, Button, TextInput and Modal.",
5
5
  "keywords": [
6
6
  "design-system",
@@ -50,6 +50,16 @@
50
50
  "default": "./dist/Button.cjs"
51
51
  }
52
52
  },
53
+ "./Direction": {
54
+ "import": {
55
+ "types": "./dist/Direction.d.mts",
56
+ "default": "./dist/Direction.mjs"
57
+ },
58
+ "require": {
59
+ "types": "./dist/Direction.d.cts",
60
+ "default": "./dist/Direction.cjs"
61
+ }
62
+ },
53
63
  "./Flex": {
54
64
  "import": {
55
65
  "types": "./dist/Flex.d.mts",
@@ -137,10 +147,11 @@
137
147
  },
138
148
  "dependencies": {
139
149
  "@soroush.tech/styled-system": "6.1.0",
140
- "@umber-style/core": "0.9.3",
141
- "@umber-style/is-prop-valid": "0.9.3",
142
- "@umber-style/react-native": "0.9.3",
143
- "@gild-ui/core": "^0.1.0-alpha.2"
150
+ "@umber-style/core": "0.10.0",
151
+ "@umber-style/is-prop-valid": "0.10.0",
152
+ "@umber-style/react-native": "0.10.0",
153
+ "@umber-style/rtl": "0.10.0",
154
+ "@gild-ui/core": "^0.1.0-alpha.3"
144
155
  },
145
156
  "peerDependencies": {
146
157
  "react": "^19.2.8",
@@ -159,7 +170,7 @@
159
170
  "tsdown": "^0.23.7",
160
171
  "typescript": "~7.0.2",
161
172
  "vitest": "^5.1.2",
162
- "@gild-ui/react": "0.1.0-alpha.2",
173
+ "@gild-ui/react": "0.1.0-alpha.3",
163
174
  "@soroush.tech/eslint-config": "0.0.0"
164
175
  },
165
176
  "scripts": {