@contractspec/lib.design-system 3.8.10 → 3.9.0

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.
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import { type ButtonProps } from './Button';
4
4
  declare const _actionBtn: (props?: ({
5
5
  tone?: "outline" | "neutral" | "danger" | "subtle" | null | undefined;
6
- size?: "sm" | "lg" | "md" | "icon" | null | undefined;
6
+ size?: "sm" | "md" | "lg" | "icon" | null | undefined;
7
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
8
  type ActionBtnProps = Omit<ButtonProps, 'size' | 'variant'> & VariantProps<typeof _actionBtn> & {
9
9
  label?: React.ReactNode;
@@ -2,8 +2,8 @@ import { type VariantProps } from 'class-variance-authority';
2
2
  import * as React from 'react';
3
3
  import { type ButtonProps } from './Button';
4
4
  declare const _ctaVariants: (props?: ({
5
- size?: "sm" | "lg" | "md" | "touch" | null | undefined;
6
- emphasis?: "strong" | "default" | "subtle" | null | undefined;
5
+ size?: "sm" | "md" | "lg" | "touch" | null | undefined;
6
+ emphasis?: "default" | "strong" | "subtle" | null | undefined;
7
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
8
  export type CtaProps = Omit<ButtonProps, 'size'> & VariantProps<typeof _ctaVariants> & {
9
9
  capture?: (cta: string) => void;
@@ -10,11 +10,12 @@ interface BaseFieldProps {
10
10
  onBlur?: () => void;
11
11
  placeholder?: string;
12
12
  disabled?: boolean;
13
+ readOnly?: boolean;
13
14
  maxLength?: number;
14
15
  className?: string;
15
16
  keyboard?: KeyboardOptions;
16
17
  }
17
18
  type NativeInputComponentProps = React.ComponentProps<typeof NativeInput>;
18
19
  export type InputProps = Omit<NativeInputComponentProps, 'onChangeText' | 'value' | 'defaultValue'> & BaseFieldProps;
19
- export declare function Input({ value, defaultValue, onChange, onSubmit, onFocus, onBlur, placeholder, disabled, maxLength, className, keyboard, ...rest }: InputProps): import("react/jsx-runtime").JSX.Element;
20
+ export declare function Input({ value, defaultValue, onChange, onSubmit, onFocus, onBlur, placeholder, disabled, readOnly, maxLength, className, keyboard, ...rest }: InputProps): import("react/jsx-runtime").JSX.Element;
20
21
  export default Input;
@@ -1,7 +1,7 @@
1
1
  import { type VariantProps } from 'class-variance-authority';
2
2
  import * as React from 'react';
3
3
  declare const spinnerVariants: (props?: ({
4
- size?: "sm" | "lg" | "md" | null | undefined;
4
+ size?: "sm" | "md" | "lg" | null | undefined;
5
5
  tone?: "default" | "muted" | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
7
  export type LoaderCircularProps = React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof spinnerVariants> & {
@@ -1,6 +1,6 @@
1
1
  import { type VariantProps } from 'class-variance-authority';
2
2
  declare const badgeVariants: (props?: ({
3
- size?: "sm" | "lg" | "md" | null | undefined;
3
+ size?: "sm" | "md" | "lg" | null | undefined;
4
4
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
5
5
  export type RankBadgeProps = VariantProps<typeof badgeVariants> & {
6
6
  rank: number;
@@ -1,6 +1,6 @@
1
1
  import { type VariantProps } from 'class-variance-authority';
2
2
  declare const sizeVariants: (props?: ({
3
- size?: "sm" | "lg" | "md" | null | undefined;
3
+ size?: "sm" | "md" | "lg" | null | undefined;
4
4
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
5
5
  export type ScoreBarProps = VariantProps<typeof sizeVariants> & {
6
6
  score: number;
@@ -10,11 +10,12 @@ interface BaseFieldProps {
10
10
  onBlur?: () => void;
11
11
  placeholder?: string;
12
12
  disabled?: boolean;
13
+ readOnly?: boolean;
13
14
  maxLength?: number;
14
15
  className?: string;
15
16
  keyboard?: KeyboardOptions;
16
17
  }
17
18
  type NativeTextareaComponentProps = React.ComponentProps<typeof NativeTextarea>;
18
19
  export type TextareaProps = Omit<NativeTextareaComponentProps, 'onChangeText' | 'value' | 'defaultValue'> & BaseFieldProps;
19
- export declare function Textarea({ value, defaultValue, onChange, onSubmit, onFocus, onBlur, placeholder, disabled, maxLength, className, keyboard, ...rest }: TextareaProps): import("react/jsx-runtime").JSX.Element;
20
+ export declare function Textarea({ value, defaultValue, onChange, onSubmit, onFocus, onBlur, placeholder, disabled, readOnly, maxLength, className, keyboard, ...rest }: TextareaProps): import("react/jsx-runtime").JSX.Element;
20
21
  export default Textarea;
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  declare const headingVariants: (props?: ({
4
4
  level?: "h1" | "h2" | "h3" | "h4" | null | undefined;
5
5
  tone?: "default" | "muted" | "accent" | null | undefined;
6
- spacing?: "none" | "sm" | "lg" | "md" | null | undefined;
6
+ spacing?: "sm" | "md" | "lg" | "none" | null | undefined;
7
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
8
  export type LegalHeadingProps = React.HTMLAttributes<HTMLHeadingElement> & VariantProps<typeof headingVariants> & {
9
9
  as?: 'h1' | 'h2' | 'h3' | 'h4';
@@ -2,7 +2,7 @@ import { type VariantProps } from 'class-variance-authority';
2
2
  import * as React from 'react';
3
3
  declare const listVariants: (props?: ({
4
4
  type?: "none" | "unordered" | "ordered" | null | undefined;
5
- spacing?: "sm" | "lg" | "md" | null | undefined;
5
+ spacing?: "sm" | "md" | "lg" | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
7
  export type LegalListProps = React.HTMLAttributes<HTMLUListElement | HTMLOListElement> & VariantProps<typeof listVariants>;
8
8
  export declare function LegalList({ type, spacing, className, children, ...props }: LegalListProps): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import { type VariantProps } from 'class-variance-authority';
2
2
  import * as React from 'react';
3
3
  declare const sectionVariants: (props?: ({
4
- spacing?: "sm" | "lg" | "md" | null | undefined;
5
- border?: "none" | "top" | "bottom" | "both" | null | undefined;
4
+ spacing?: "sm" | "md" | "lg" | null | undefined;
5
+ border?: "none" | "both" | "top" | "bottom" | null | undefined;
6
6
  tone?: "subtle" | "plain" | null | undefined;
7
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
8
  export type LegalSectionProps = React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof sectionVariants>;
@@ -2,8 +2,8 @@ import { type VariantProps } from 'class-variance-authority';
2
2
  import * as React from 'react';
3
3
  declare const textVariants: (props?: ({
4
4
  tone?: "default" | "danger" | "muted" | null | undefined;
5
- size?: "base" | "sm" | "lg" | null | undefined;
6
- spacing?: "none" | "sm" | "lg" | "md" | null | undefined;
5
+ size?: "sm" | "lg" | "base" | null | undefined;
6
+ spacing?: "sm" | "md" | "lg" | "none" | null | undefined;
7
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
8
  export type LegalTextProps = React.HTMLAttributes<HTMLParagraphElement> & VariantProps<typeof textVariants> & {
9
9
  as?: 'p' | 'div' | 'span';
@@ -5,7 +5,7 @@ export interface TocItem {
5
5
  label: React.ReactNode;
6
6
  }
7
7
  declare const tocVariants: (props?: ({
8
- variant?: "inline" | "sidebar" | null | undefined;
8
+ variant?: "sidebar" | "inline" | null | undefined;
9
9
  size?: "sm" | "md" | null | undefined;
10
10
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
11
11
  export type LegalTOCProps = {
@@ -2,7 +2,7 @@ import { type VariantProps } from 'class-variance-authority';
2
2
  import * as React from 'react';
3
3
  import { MarketingSection } from './MarketingSection';
4
4
  declare const gridVariants: (props?: ({
5
- columns?: 1 | 2 | 4 | 3 | null | undefined;
5
+ columns?: 2 | 3 | 4 | 1 | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
7
  type MarketingCardsSectionProps = React.PropsWithChildren<Omit<React.ComponentProps<typeof MarketingSection>, 'children'> & VariantProps<typeof gridVariants> & {
8
8
  gridClassName?: string;
@@ -2,7 +2,7 @@ import { Card } from '@contractspec/lib.ui-kit-web/ui/card';
2
2
  import { type VariantProps } from 'class-variance-authority';
3
3
  import * as React from 'react';
4
4
  declare const entityCardVariants: (props?: ({
5
- emphasis?: "strong" | "default" | "subtle" | "accentGradient" | null | undefined;
5
+ emphasis?: "default" | "strong" | "subtle" | "accentGradient" | null | undefined;
6
6
  density?: "compact" | "comfortable" | null | undefined;
7
7
  interactive?: boolean | null | undefined;
8
8
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -2,7 +2,7 @@ import { Card } from '@contractspec/lib.ui-kit-web/ui/card';
2
2
  import { type VariantProps } from 'class-variance-authority';
3
3
  import * as React from 'react';
4
4
  declare const statVariants: (props?: ({
5
- emphasis?: "strong" | "default" | "subtle" | null | undefined;
5
+ emphasis?: "default" | "strong" | "subtle" | null | undefined;
6
6
  density?: "compact" | "comfortable" | null | undefined;
7
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
8
  export type StatCardProps = React.ComponentProps<typeof Card> & VariantProps<typeof statVariants> & {
@@ -16,7 +16,7 @@ export interface FlatListScreenProps<T> extends Omit<FlatListProps<T>, 'data' |
16
16
  emptyText?: string;
17
17
  }
18
18
  declare const containerVariants: (props?: ({
19
- padding?: "none" | "sm" | "lg" | "md" | null | undefined;
19
+ padding?: "sm" | "md" | "lg" | "none" | null | undefined;
20
20
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
21
21
  export declare function FlatListScreen<T>({ children, data, renderItem, header, className, contentClassName, edges, showsVerticalScrollIndicator, keyboardShouldPersistTaps, onRefresh, refreshing, emptyComponent, emptyText, padding, ...flatListProps }: FlatListScreenProps<T>): import("react/jsx-runtime").JSX.Element;
22
22
  export {};
@@ -1,7 +1,7 @@
1
1
  import { type VariantProps } from 'class-variance-authority';
2
2
  import * as React from 'react';
3
3
  declare const gridVariants: (props?: ({
4
- gap?: "sm" | "lg" | "md" | null | undefined;
4
+ gap?: "sm" | "md" | "lg" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  export declare function GridLayout({ children, className, columns, gap, }: {
7
7
  children: React.ReactNode;
@@ -4,7 +4,7 @@ declare const containerVariants: (props?: ({
4
4
  density?: "compact" | "comfortable" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  declare const gridVariants: (props?: ({
7
- size?: "sm" | "lg" | "md" | null | undefined;
7
+ size?: "sm" | "md" | "lg" | null | undefined;
8
8
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
9
  export interface ListCardPageProps<T> extends VariantProps<typeof containerVariants>, VariantProps<typeof gridVariants> {
10
10
  title: React.ReactNode;
@@ -4,7 +4,7 @@ declare const containerVariants: (props?: ({
4
4
  density?: "compact" | "comfortable" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  declare const gridGapVariants: (props?: ({
7
- size?: "sm" | "lg" | "md" | null | undefined;
7
+ size?: "sm" | "md" | "lg" | null | undefined;
8
8
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
9
  export interface ListGridPageProps<T> extends VariantProps<typeof containerVariants>, VariantProps<typeof gridGapVariants> {
10
10
  title: React.ReactNode;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { TranslationRegistry } from '@contractspec/lib.contracts-spec/translations';
2
+ import * as React from 'react';
3
+ export type DesignSystemTranslationResolver = (key: string) => string | undefined;
4
+ export declare function DesignSystemTranslationProvider({ children, resolver, }: {
5
+ children: React.ReactNode;
6
+ resolver?: DesignSystemTranslationResolver;
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ export declare function useDesignSystemTranslation(): DesignSystemTranslationResolver | undefined;
9
+ export declare function resolveTranslationString(value: string | undefined, resolver?: DesignSystemTranslationResolver): string | undefined;
10
+ export declare function resolveTranslationNode(value: React.ReactNode, resolver?: DesignSystemTranslationResolver): string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
11
+ export declare function createTranslationResolver({ registry, locale, fallbackLocale, specKeys, }: {
12
+ registry: TranslationRegistry;
13
+ locale: string;
14
+ fallbackLocale?: string;
15
+ specKeys?: string[];
16
+ }): DesignSystemTranslationResolver;
package/dist/index.d.ts CHANGED
@@ -116,11 +116,13 @@ export { VisualizationCard, type VisualizationCardProps, } from './components/vi
116
116
  export { VisualizationGrid, type VisualizationGridProps, } from './components/visualization/VisualizationGrid';
117
117
  export { VisualizationRenderer, type VisualizationRendererProps, } from './components/visualization/VisualizationRenderer';
118
118
  export { useListUrlState } from './hooks/useListUrlState';
119
+ export * from './i18n/translation';
119
120
  export { useColorScheme } from './platform/useColorScheme';
120
121
  export { useReducedMotion } from './platform/useReducedMotion';
121
122
  export { useResponsive } from './platform/useResponsive';
122
123
  export * from './platform/withPlatformUI';
123
124
  export * from './renderers';
125
+ export * from './theme/contracts';
124
126
  export { mapTokensForPlatform } from './theme/tokenBridge';
125
127
  export * from './theme/tokens';
126
128
  export * from './theme/variants';