@tachui/modifiers 0.8.0-alpha
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/LICENSE +363 -0
- package/README.md +322 -0
- package/dist/allows-hit-testing-DscPrcOw.js +464 -0
- package/dist/allows-hit-testing-DscPrcOw.js.map +1 -0
- package/dist/appearance/background.d.ts +38 -0
- package/dist/appearance/background.d.ts.map +1 -0
- package/dist/appearance/border.d.ts +78 -0
- package/dist/appearance/border.d.ts.map +1 -0
- package/dist/appearance/clip-shape.d.ts +23 -0
- package/dist/appearance/clip-shape.d.ts.map +1 -0
- package/dist/appearance/clipped.d.ts +21 -0
- package/dist/appearance/clipped.d.ts.map +1 -0
- package/dist/appearance/foreground.d.ts +19 -0
- package/dist/appearance/foreground.d.ts.map +1 -0
- package/dist/appearance/index.d.ts +11 -0
- package/dist/appearance/index.d.ts.map +1 -0
- package/dist/appearance/index.js +34 -0
- package/dist/appearance/index.js.map +1 -0
- package/dist/attributes/aria.d.ts +101 -0
- package/dist/attributes/aria.d.ts.map +1 -0
- package/dist/attributes/css-properties.d.ts +229 -0
- package/dist/attributes/css-properties.d.ts.map +1 -0
- package/dist/attributes/html.d.ts +108 -0
- package/dist/attributes/html.d.ts.map +1 -0
- package/dist/attributes/index.d.ts +12 -0
- package/dist/attributes/index.d.ts.map +1 -0
- package/dist/base-CkGf4b9G.js +786 -0
- package/dist/base-CkGf4b9G.js.map +1 -0
- package/dist/base.d.ts +154 -0
- package/dist/base.d.ts.map +1 -0
- package/dist/base.js +842 -0
- package/dist/base.js.map +1 -0
- package/dist/basic/base.d.ts +147 -0
- package/dist/basic/base.d.ts.map +1 -0
- package/dist/basic/index.d.ts +9 -0
- package/dist/basic/index.d.ts.map +1 -0
- package/dist/basic/margin.d.ts +266 -0
- package/dist/basic/margin.d.ts.map +1 -0
- package/dist/basic/margin.js +160 -0
- package/dist/basic/margin.js.map +1 -0
- package/dist/basic/padding.d.ts +258 -0
- package/dist/basic/padding.d.ts.map +1 -0
- package/dist/basic/padding.js +155 -0
- package/dist/basic/padding.js.map +1 -0
- package/dist/basic/size.d.ts +113 -0
- package/dist/basic/size.d.ts.map +1 -0
- package/dist/basic/size.js +78 -0
- package/dist/basic/size.js.map +1 -0
- package/dist/clipped-CCW8gJqJ.js +282 -0
- package/dist/clipped-CCW8gJqJ.js.map +1 -0
- package/dist/css-CJEXRr6H.js +124 -0
- package/dist/css-CJEXRr6H.js.map +1 -0
- package/dist/elements/decorative.d.ts +109 -0
- package/dist/elements/decorative.d.ts.map +1 -0
- package/dist/elements/index.d.ts +6 -0
- package/dist/elements/index.d.ts.map +1 -0
- package/dist/elements/pseudo-elements.d.ts +145 -0
- package/dist/elements/pseudo-elements.d.ts.map +1 -0
- package/dist/font-3qM2Z97N.js +135 -0
- package/dist/font-3qM2Z97N.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +885 -0
- package/dist/index.js.map +1 -0
- package/dist/interaction/allows-hit-testing.d.ts +31 -0
- package/dist/interaction/allows-hit-testing.d.ts.map +1 -0
- package/dist/interaction/focusable.d.ts +33 -0
- package/dist/interaction/focusable.d.ts.map +1 -0
- package/dist/interaction/focused.d.ts +28 -0
- package/dist/interaction/focused.d.ts.map +1 -0
- package/dist/interaction/index.d.ts +11 -0
- package/dist/interaction/index.d.ts.map +1 -0
- package/dist/interaction/index.js +32 -0
- package/dist/interaction/index.js.map +1 -0
- package/dist/interaction/keyboard-shortcut.d.ts +30 -0
- package/dist/interaction/keyboard-shortcut.d.ts.map +1 -0
- package/dist/interaction/on-continuous-hover.d.ts +41 -0
- package/dist/interaction/on-continuous-hover.d.ts.map +1 -0
- package/dist/interaction/on-long-press-gesture.d.ts +26 -0
- package/dist/interaction/on-long-press-gesture.d.ts.map +1 -0
- package/dist/interaction/scroll.d.ts +143 -0
- package/dist/interaction/scroll.d.ts.map +1 -0
- package/dist/layout/aspect-ratio.d.ts +65 -0
- package/dist/layout/aspect-ratio.d.ts.map +1 -0
- package/dist/layout/fixed-size.d.ts +49 -0
- package/dist/layout/fixed-size.d.ts.map +1 -0
- package/dist/layout/flexbox.d.ts +253 -0
- package/dist/layout/flexbox.d.ts.map +1 -0
- package/dist/layout/index.d.ts +19 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/index.js +30 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/layout/offset.d.ts +44 -0
- package/dist/layout/offset.d.ts.map +1 -0
- package/dist/layout/overlay.d.ts +26 -0
- package/dist/layout/overlay.d.ts.map +1 -0
- package/dist/layout/position.d.ts +55 -0
- package/dist/layout/position.d.ts.map +1 -0
- package/dist/layout/scale-effect.d.ts +51 -0
- package/dist/layout/scale-effect.d.ts.map +1 -0
- package/dist/layout/z-index.d.ts +65 -0
- package/dist/layout/z-index.d.ts.map +1 -0
- package/dist/overlay-DDiSLprp.js +774 -0
- package/dist/overlay-DDiSLprp.js.map +1 -0
- package/dist/responsive/index.d.ts +10 -0
- package/dist/responsive/index.d.ts.map +1 -0
- package/dist/types.d.ts +598 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/typography/font.d.ts +24 -0
- package/dist/typography/font.d.ts.map +1 -0
- package/dist/typography/index.d.ts +9 -0
- package/dist/typography/index.d.ts.map +1 -0
- package/dist/typography/index.js +30 -0
- package/dist/typography/index.js.map +1 -0
- package/dist/typography/text.d.ts +70 -0
- package/dist/typography/text.d.ts.map +1 -0
- package/dist/typography/text.js +129 -0
- package/dist/typography/text.js.map +1 -0
- package/dist/typography/typography.d.ts +52 -0
- package/dist/typography/typography.d.ts.map +1 -0
- package/dist/utility/css.d.ts +86 -0
- package/dist/utility/css.d.ts.map +1 -0
- package/dist/utility/index.d.ts +6 -0
- package/dist/utility/index.d.ts.map +1 -0
- package/dist/utility/index.js +17 -0
- package/dist/utility/index.js.map +1 -0
- package/dist/utility/utility.d.ts +69 -0
- package/dist/utility/utility.d.ts.map +1 -0
- package/package.json +117 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["/**\n * SwiftUI Modifier System Types\n *\n * Core type definitions for the SwiftUI-inspired modifier system.\n * Enables chaining modifiers on components similar to SwiftUI.\n */\n\nimport type { Signal } from '@tachui/core/reactive/types'\nimport type {\n ComponentInstance,\n ComponentProps,\n DOMNode,\n} from '@tachui/core/runtime/types'\n\n// Re-export for convenience\nexport type { DOMNode } from '@tachui/core/runtime/types'\n// Temporary type definitions until we migrate all types\nexport type Dimension = number | string | 'infinity'\nexport interface StatefulBackgroundValue {\n default: any\n hover?: any\n active?: any\n focus?: any\n disabled?: any\n}\n\n// Basic asset interfaces - simplified for now\nexport interface Asset {\n resolve(): any\n}\nexport interface ColorAssetProxy extends Asset {}\nexport interface ImageAssetProxy extends Asset {}\nexport interface FontAssetProxy extends Asset {}\n\n/**\n * Valid color value types for modifiers\n */\nexport type ColorValue = string | Asset | ColorAssetProxy | Signal<string>\n\n/**\n * Valid asset types for modifiers\n */\nexport type AssetValue =\n | Asset\n | ColorAssetProxy\n | ImageAssetProxy\n | FontAssetProxy\n\n/**\n * Text component interface for type safety with asHTML modifier\n */\nexport interface TextComponent extends ComponentInstance {\n readonly __tachui_component_type: 'Text'\n content: string\n}\n\n/**\n * Base modifier interface that all modifiers must implement\n */\nexport interface Modifier<TProps = {}> {\n readonly type: string\n readonly priority: number\n readonly properties: TProps\n apply(node: DOMNode, context: ModifierContext): DOMNode | undefined\n}\n\n/**\n * Context passed to modifiers during application\n */\nexport interface ModifierContext {\n componentId: string\n componentInstance?: ComponentInstance\n element?: Element\n parentElement?: Element\n phase: 'creation' | 'update' | 'cleanup'\n previousModifiers?: Modifier[]\n}\n\n/**\n * Modifier application result\n */\nexport interface ModifierResult {\n node: DOMNode\n effects?: (() => void)[]\n cleanup?: (() => void)[]\n}\n\n/**\n * Reactive modifier properties that can contain signals\n */\nexport type ReactiveModifierProps<T> = {\n [K in keyof T]: T[K] | Signal<T[K]>\n}\n\n/**\n * Strict TextShadow configuration interface\n * Prevents common mistakes like using 'radius' instead of 'blur'\n */\nexport interface TextShadowConfig {\n readonly x: number\n readonly y: number\n readonly blur: number\n readonly color: string\n}\n\n/**\n * Layout modifier properties\n */\nexport interface LayoutModifierProps {\n frame?: {\n width?: Dimension\n height?: Dimension\n minWidth?: Dimension\n maxWidth?: Dimension\n minHeight?: Dimension\n maxHeight?: Dimension\n }\n padding?:\n | {\n top?: number\n right?: number\n bottom?: number\n left?: number\n }\n | number\n margin?:\n | {\n top?: number | string\n right?: number | string\n bottom?: number | string\n left?: number | string\n }\n | number\n | string\n alignment?: 'leading' | 'center' | 'trailing' | 'top' | 'bottom'\n layoutPriority?: number\n offset?: {\n x?: number\n y?: number\n }\n aspectRatio?: {\n ratio?: number\n contentMode?: 'fit' | 'fill'\n }\n fixedSize?: {\n horizontal?: boolean\n vertical?: boolean\n }\n // Transform Properties (Phase 3 - Epic: Butternut)\n scaleEffect?: {\n x?: number\n y?: number\n anchor?:\n | 'center'\n | 'top'\n | 'topLeading'\n | 'topTrailing'\n | 'bottom'\n | 'bottomLeading'\n | 'bottomTrailing'\n | 'leading'\n | 'trailing'\n }\n position?: {\n x?: number\n y?: number\n }\n zIndex?: number\n}\n\n/**\n * Appearance modifier properties\n */\nexport interface AppearanceModifierProps {\n foregroundColor?: ColorValue\n backgroundColor?: ColorValue\n background?: StatefulBackgroundValue\n opacity?: number\n font?: {\n family?: string\n size?: number | string | Signal<number> | Signal<string>\n weight?:\n | 'normal'\n | 'bold'\n | '100'\n | '200'\n | '300'\n | '400'\n | '500'\n | '600'\n | '700'\n | '800'\n | '900'\n style?: 'normal' | 'italic' | 'oblique'\n }\n cornerRadius?: number\n border?: {\n width?: number | Signal<number>\n color?: ColorValue\n style?: 'solid' | 'dashed' | 'dotted'\n }\n shadow?: {\n color?: string\n radius?: number\n x?: number\n y?: number\n }\n clipped?: boolean\n clipShape?: {\n shape: 'circle' | 'ellipse' | 'rect' | 'polygon'\n parameters?: Record<string, any>\n }\n // Visual Effects (Phase 2 - Epic: Butternut)\n blur?: number // CSS filter: blur(Npx)\n brightness?: number // CSS filter: brightness(N) - 1.0 is normal\n contrast?: number // CSS filter: contrast(N) - 1.0 is normal\n saturation?: number // CSS filter: saturate(N) - 1.0 is normal\n hueRotation?: number // CSS filter: hue-rotate(Ndeg)\n grayscale?: number // CSS filter: grayscale(N) - 0.0 to 1.0\n colorInvert?: number // CSS filter: invert(N) - 0.0 to 1.0\n}\n\n/**\n * Interaction modifier properties\n */\nexport interface InteractionModifierProps {\n // Existing mouse events\n onTap?: (event: MouseEvent) => void\n onHover?: (isHovered: boolean) => void\n onMouseEnter?: (event: MouseEvent) => void\n onMouseLeave?: (event: MouseEvent) => void\n onMouseDown?: (event: MouseEvent) => void\n onMouseUp?: (event: MouseEvent) => void\n onDoubleClick?: (event: MouseEvent) => void\n onContextMenu?: (event: MouseEvent) => void\n\n // Existing drag events\n onDragStart?: (event: DragEvent) => void\n onDragOver?: (event: DragEvent) => void\n onDragLeave?: (event: DragEvent) => void\n onDrop?: (event: DragEvent) => void\n\n // Focus events (onFocus exists, adding onBlur)\n onFocus?: (isFocused: boolean) => void\n onBlur?: (isFocused: boolean) => void\n\n // Keyboard events\n onKeyPress?: (event: KeyboardEvent) => void\n onKeyDown?: (event: KeyboardEvent) => void\n onKeyUp?: (event: KeyboardEvent) => void\n\n // Scroll and wheel events\n onScroll?: (event: Event) => void\n onWheel?: (event: WheelEvent) => void\n\n // Input events\n onInput?: (event: InputEvent) => void\n onChange?: (value: any, event?: Event) => void\n\n // Clipboard events\n onCopy?: (event: ClipboardEvent) => void\n onCut?: (event: ClipboardEvent) => void\n onPaste?: (event: ClipboardEvent) => void\n\n // Touch events\n onTouchStart?: (event: TouchEvent) => void\n onTouchMove?: (event: TouchEvent) => void\n onTouchEnd?: (event: TouchEvent) => void\n onTouchCancel?: (event: TouchEvent) => void\n\n // Other events\n onSelect?: (event: Event) => void\n\n // Advanced Gesture Modifiers (Phase 4 - Epic: Butternut)\n onLongPressGesture?: {\n minimumDuration?: number // ms, default 500\n maximumDistance?: number // px, default 10\n perform: () => void\n onPressingChanged?: (isPressing: boolean) => void\n }\n\n // Keyboard Shortcuts (Phase 4 - Epic: Butternut)\n keyboardShortcut?: {\n key: string\n modifiers?: ('cmd' | 'ctrl' | 'shift' | 'alt' | 'meta')[]\n action: () => void\n }\n\n // Focus Management (Phase 4 - Epic: Butternut)\n focused?: boolean | Signal<boolean>\n focusable?: {\n isFocusable?: boolean\n interactions?: ('activate' | 'edit')[]\n }\n\n // Enhanced Hover Tracking (Phase 4 - Epic: Butternut)\n onContinuousHover?: {\n coordinateSpace?: 'local' | 'global'\n perform: (location: { x: number; y: number } | null) => void\n }\n\n // Gesture Priority System (Phase 4 - Epic: Butternut)\n highPriorityGesture?: {\n gesture: any // Will define gesture types later\n including?: ('all' | 'subviews' | 'none')[]\n }\n simultaneousGesture?: {\n gesture: any\n including?: ('all' | 'subviews' | 'none')[]\n }\n\n // Hit Testing Control (Phase 4 - Epic: Butternut)\n allowsHitTesting?: boolean\n\n // Existing state properties\n disabled?: boolean\n draggable?: boolean\n accessibilityLabel?: string\n accessibilityHint?: string\n}\n\n/**\n * Animation modifier properties\n */\nexport interface AnimationModifierProps {\n transition?: {\n property?: string\n duration?: number\n easing?: string\n delay?: number\n }\n animation?: {\n keyframes?: Record<string, Record<string, string>>\n duration?: number\n easing?: string\n iterations?: number | 'infinite'\n direction?: 'normal' | 'reverse' | 'alternate' | 'alternate-reverse'\n }\n transform?: string | Signal<string>\n rotationEffect?: {\n angle: number\n anchor?:\n | 'center'\n | 'top'\n | 'topLeading'\n | 'topTrailing'\n | 'bottom'\n | 'bottomLeading'\n | 'bottomTrailing'\n | 'leading'\n | 'trailing'\n }\n overlay?: {\n content: any // ComponentInstance or function that returns ComponentInstance\n alignment?:\n | 'center'\n | 'top'\n | 'bottom'\n | 'leading'\n | 'trailing'\n | 'topLeading'\n | 'topTrailing'\n | 'bottomLeading'\n | 'bottomTrailing'\n }\n}\n\n/**\n * Lifecycle modifier properties\n */\nexport interface LifecycleModifierProps {\n onAppear?: () => void\n onDisappear?: () => void\n task?: {\n operation: () => Promise<void> | void\n id?: string\n priority?: 'background' | 'userInitiated' | 'utility' | 'default'\n }\n refreshable?: {\n onRefresh: () => Promise<void>\n isRefreshing?: boolean | Signal<boolean>\n }\n}\n\n/**\n * Modifier factory function type\n */\nexport type ModifierFactory<TProps = {}> = (\n props: ReactiveModifierProps<TProps>\n) => Modifier<TProps>\n\n/**\n * Modifier builder interface for creating chainable modifiers\n */\nexport interface ModifierBuilder<\n T extends ComponentInstance = ComponentInstance,\n> {\n // Layout modifiers\n frame(width?: Dimension, height?: Dimension): ModifierBuilder<T>\n frame(options: LayoutModifierProps['frame']): ModifierBuilder<T>\n padding(value: number): ModifierBuilder<T>\n padding(options: LayoutModifierProps['padding']): ModifierBuilder<T>\n margin(value: number | string): ModifierBuilder<T>\n margin(options: LayoutModifierProps['margin']): ModifierBuilder<T>\n\n // New multi-property modifiers\n size(options: {\n width?: Dimension\n height?: Dimension\n minWidth?: Dimension\n maxWidth?: Dimension\n minHeight?: Dimension\n maxHeight?: Dimension\n }): ModifierBuilder<T>\n width(value: Dimension): ModifierBuilder<T>\n height(value: Dimension): ModifierBuilder<T>\n maxWidth(value: Dimension): ModifierBuilder<T>\n minWidth(value: Dimension): ModifierBuilder<T>\n maxHeight(value: Dimension): ModifierBuilder<T>\n minHeight(value: Dimension): ModifierBuilder<T>\n marginTop(value: number | string): ModifierBuilder<T>\n marginBottom(value: number | string): ModifierBuilder<T>\n marginHorizontal(value: number | string): ModifierBuilder<T>\n marginVertical(value: number | string): ModifierBuilder<T>\n\n // Typography modifiers\n typography(options: {\n size?: number | string\n weight?: string | number\n family?: string\n lineHeight?: number | string\n letterSpacing?: number | string\n align?: string\n transform?: string\n decoration?: string\n variant?: string\n style?: string\n color?: string\n }): ModifierBuilder<T>\n textAlign(\n value: 'left' | 'center' | 'right' | 'justify' | 'start' | 'end'\n ): ModifierBuilder<T>\n textTransform(\n value: 'none' | 'uppercase' | 'lowercase' | 'capitalize'\n ): ModifierBuilder<T>\n letterSpacing(value: number | string): ModifierBuilder<T>\n lineHeight(value: number | string): ModifierBuilder<T>\n gradientText(gradient: string): ModifierBuilder<T>\n\n // Border modifiers\n borderTop(\n width: number | Signal<number>,\n color: ColorValue,\n style?:\n | 'solid'\n | 'dashed'\n | 'dotted'\n | 'double'\n | 'groove'\n | 'ridge'\n | 'inset'\n | 'outset'\n ): ModifierBuilder<T>\n borderRight(\n width: number | Signal<number>,\n color: ColorValue,\n style?:\n | 'solid'\n | 'dashed'\n | 'dotted'\n | 'double'\n | 'groove'\n | 'ridge'\n | 'inset'\n | 'outset'\n ): ModifierBuilder<T>\n borderBottom(\n width: number | Signal<number>,\n color: ColorValue,\n style?:\n | 'solid'\n | 'dashed'\n | 'dotted'\n | 'double'\n | 'groove'\n | 'ridge'\n | 'inset'\n | 'outset'\n ): ModifierBuilder<T>\n borderLeft(\n width: number | Signal<number>,\n color: ColorValue,\n style?:\n | 'solid'\n | 'dashed'\n | 'dotted'\n | 'double'\n | 'groove'\n | 'ridge'\n | 'inset'\n | 'outset'\n ): ModifierBuilder<T>\n\n // Flexbox modifiers\n flexGrow(value: number): ModifierBuilder<T>\n flexShrink(value: number): ModifierBuilder<T>\n justifyContent(\n value:\n | 'flex-start'\n | 'flex-end'\n | 'center'\n | 'space-between'\n | 'space-around'\n | 'space-evenly'\n ): ModifierBuilder<T>\n alignItems(\n value: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline'\n ): ModifierBuilder<T>\n gap(value: number | string): ModifierBuilder<T>\n flexDirection(\n value: 'row' | 'row-reverse' | 'column' | 'column-reverse'\n ): ModifierBuilder<T>\n flexWrap(value: 'nowrap' | 'wrap' | 'wrap-reverse'): ModifierBuilder<T>\n\n // Utility modifiers\n cursor(\n value:\n | 'auto'\n | 'default'\n | 'pointer'\n | 'text'\n | 'wait'\n | 'help'\n | 'not-allowed'\n | 'grab'\n | 'grabbing'\n ): ModifierBuilder<T>\n overflowY(value: 'visible' | 'hidden' | 'scroll' | 'auto'): ModifierBuilder<T>\n overflowX(value: 'visible' | 'hidden' | 'scroll' | 'auto'): ModifierBuilder<T>\n position(\n value: 'static' | 'relative' | 'absolute' | 'fixed' | 'sticky'\n ): ModifierBuilder<T>\n zIndex(value: number): ModifierBuilder<T>\n display(\n value:\n | 'block'\n | 'inline'\n | 'inline-block'\n | 'flex'\n | 'inline-flex'\n | 'grid'\n | 'none'\n ): ModifierBuilder<T>\n transform(value: string | Signal<string>): ModifierBuilder<T>\n\n // Raw CSS modifiers\n css(properties: {\n [property: string]: string | number | undefined\n }): ModifierBuilder<T>\n cssProperty(property: string, value: string | number): ModifierBuilder<T>\n cssVariable(name: string, value: string | number): ModifierBuilder<T>\n\n // Phase 1 SwiftUI modifiers\n offset(\n x: number | Signal<number>,\n y?: number | Signal<number>\n ): ModifierBuilder<T>\n clipped(): ModifierBuilder<T>\n rotationEffect(\n angle: number | Signal<number>,\n anchor?:\n | 'center'\n | 'top'\n | 'topLeading'\n | 'topTrailing'\n | 'bottom'\n | 'bottomLeading'\n | 'bottomTrailing'\n | 'leading'\n | 'trailing'\n ): ModifierBuilder<T>\n\n // Phase 2 SwiftUI modifiers\n aspectRatio(\n ratio?: number | Signal<number>,\n contentMode?: 'fit' | 'fill'\n ): ModifierBuilder<T>\n fixedSize(horizontal?: boolean, vertical?: boolean): ModifierBuilder<T>\n clipShape(\n shape: 'circle' | 'ellipse' | 'rect' | 'polygon',\n parameters?: Record<string, any>\n ): ModifierBuilder<T>\n overlay(\n content: any,\n alignment?:\n | 'center'\n | 'top'\n | 'bottom'\n | 'leading'\n | 'trailing'\n | 'topLeading'\n | 'topTrailing'\n | 'bottomLeading'\n | 'bottomTrailing'\n ): ModifierBuilder<T>\n\n // Phase 3 SwiftUI modifiers - Critical Transform Modifiers\n scaleEffect(\n x: number | Signal<number>,\n y?: number | Signal<number>,\n anchor?:\n | 'center'\n | 'top'\n | 'topLeading'\n | 'topTrailing'\n | 'bottom'\n | 'bottomLeading'\n | 'bottomTrailing'\n | 'leading'\n | 'trailing'\n ): ModifierBuilder<T>\n\n // Note: SwiftUI-style position for absolute positioning (different from CSS position)\n absolutePosition(\n x: number | Signal<number>,\n y: number | Signal<number>\n ): ModifierBuilder<T>\n\n // Appearance modifiers\n foregroundColor(color: ColorValue): ModifierBuilder<T>\n backgroundColor(color: ColorValue): ModifierBuilder<T>\n background(\n value: StatefulBackgroundValue | Signal<string>\n ): ModifierBuilder<T>\n font(options: AppearanceModifierProps['font']): ModifierBuilder<T>\n font(size: number | string): ModifierBuilder<T>\n fontWeight(\n weight: NonNullable<AppearanceModifierProps['font']>['weight']\n ): ModifierBuilder<T>\n fontSize(\n size: number | string | Signal<number> | Signal<string>\n ): ModifierBuilder<T>\n opacity(value: number | Signal<number>): ModifierBuilder<T>\n cornerRadius(radius: number | Signal<number>): ModifierBuilder<T>\n border(width: number | Signal<number>, color?: ColorValue): ModifierBuilder<T>\n border(options: AppearanceModifierProps['border']): ModifierBuilder<T>\n borderWidth(width: number | Signal<number>): ModifierBuilder<T>\n shadow(options: AppearanceModifierProps['shadow']): ModifierBuilder<T>\n shadow(config: {\n x: number\n y: number\n blur: number\n color: string\n spread?: number\n inset?: boolean\n }): ModifierBuilder<T>\n shadows(\n configs: Array<{\n x: number\n y: number\n blur: number\n color: string\n spread?: number\n inset?: boolean\n }>\n ): ModifierBuilder<T>\n textShadow(config: TextShadowConfig): ModifierBuilder<T>\n shadowPreset(presetName: string): ModifierBuilder<T>\n\n // Visual Effects Modifiers (Phase 2 - Epic: Butternut)\n\n // ============================================================================\n // VISUAL EFFECTS METHODS MOVED TO @tachui/effects\n // ============================================================================\n // Visual effects methods (filters, transforms, backdrop, hover) have been\n // moved to @tachui/effects package. Import and use with .apply():\n //\n // import { blur, scale, glassmorphism, hoverEffect } from '@tachui/effects'\n // VStack().apply(blur(5)).apply(scale(1.1))\n //\n // This provides better tree-shaking and cleaner plugin boundaries.\n // ============================================================================\n\n // Advanced Gesture Modifiers (Phase 4 - Epic: Butternut)\n onLongPressGesture(options: {\n minimumDuration?: number\n maximumDistance?: number\n perform: () => void\n onPressingChanged?: (isPressing: boolean) => void\n }): ModifierBuilder<T>\n\n // Keyboard Shortcuts (Phase 4 - Epic: Butternut)\n keyboardShortcut(\n key: string,\n modifiers: ('cmd' | 'ctrl' | 'shift' | 'alt' | 'meta')[],\n action: () => void\n ): ModifierBuilder<T>\n\n // Focus Management (Phase 4 - Epic: Butternut)\n focused(binding: boolean | Signal<boolean>): ModifierBuilder<T>\n focusable(\n isFocusable?: boolean,\n interactions?: ('activate' | 'edit')[]\n ): ModifierBuilder<T>\n\n // Enhanced Hover Tracking (Phase 4 - Epic: Butternut)\n onContinuousHover(\n coordinateSpace: 'local' | 'global',\n perform: (location: { x: number; y: number } | null) => void\n ): ModifierBuilder<T>\n\n // Gesture Priority System (Phase 4 - Epic: Butternut)\n highPriorityGesture(\n gesture: any,\n including?: ('all' | 'subviews' | 'none')[]\n ): ModifierBuilder<T>\n simultaneousGesture(\n gesture: any,\n including?: ('all' | 'subviews' | 'none')[]\n ): ModifierBuilder<T>\n\n // Hit Testing Control (Phase 4 - Epic: Butternut)\n allowsHitTesting(enabled: boolean): ModifierBuilder<T>\n\n // HTML and ARIA Attributes\n id(value: string): ModifierBuilder<T>\n data(attributes: {\n [key: string]: string | number | boolean\n }): ModifierBuilder<T>\n aria(attributes: {\n [key: string]: string | number | boolean | undefined\n }): ModifierBuilder<T>\n tabIndex(value: number): ModifierBuilder<T>\n\n // Text Modifiers\n lineClamp(lines: number): ModifierBuilder<T>\n wordBreak(\n value: 'normal' | 'break-all' | 'keep-all' | 'break-word'\n ): ModifierBuilder<T>\n overflowWrap(value: 'normal' | 'break-word' | 'anywhere'): ModifierBuilder<T>\n hyphens(value: 'none' | 'manual' | 'auto'): ModifierBuilder<T>\n\n // Backdrop Filter Modifiers (Unified Implementation)\n backdropFilter(\n config: {\n blur?: number\n brightness?: number\n contrast?: number\n saturate?: number\n [key: string]: any\n },\n fallbackColor?: ColorValue\n ): ModifierBuilder<T>\n backdropFilter(\n cssValue: string,\n fallbackColor?: ColorValue\n ): ModifierBuilder<T>\n glassmorphism(\n intensity?: 'subtle' | 'light' | 'medium' | 'heavy',\n customFallback?: ColorValue\n ): ModifierBuilder<T>\n\n // Pseudo-element modifiers\n before(styles: {\n content: string\n color?: string\n [key: string]: any\n }): ModifierBuilder<T>\n after(styles: {\n content: string\n color?: string\n [key: string]: any\n }): ModifierBuilder<T>\n\n // State modifiers\n disabled(isDisabled?: boolean | Signal<boolean>): ModifierBuilder<T>\n\n // Animation modifiers\n transition(\n property?: string,\n duration?: number,\n easing?: string,\n delay?: number\n ): ModifierBuilder<T>\n transitions(config: any): ModifierBuilder<T>\n animation(options: AnimationModifierProps['animation']): ModifierBuilder<T>\n\n // Transition presets\n fadeTransition(duration?: number): ModifierBuilder<T>\n transformTransition(duration?: number): ModifierBuilder<T>\n colorTransition(duration?: number): ModifierBuilder<T>\n layoutTransition(duration?: number): ModifierBuilder<T>\n buttonTransition(): ModifierBuilder<T>\n cardTransition(): ModifierBuilder<T>\n modalTransition(): ModifierBuilder<T>\n smoothTransition(duration?: number): ModifierBuilder<T>\n quickTransition(duration?: number): ModifierBuilder<T>\n slowTransition(duration?: number): ModifierBuilder<T>\n\n // Scroll modifiers\n scroll(config: any): ModifierBuilder<T>\n scrollBehavior(value: 'auto' | 'smooth'): ModifierBuilder<T>\n overscrollBehavior(value: 'auto' | 'contain' | 'none'): ModifierBuilder<T>\n overscrollBehaviorX(value: 'auto' | 'contain' | 'none'): ModifierBuilder<T>\n overscrollBehaviorY(value: 'auto' | 'contain' | 'none'): ModifierBuilder<T>\n scrollMargin(\n margin:\n | number\n | string\n | {\n top?: number | string\n right?: number | string\n bottom?: number | string\n left?: number | string\n }\n ): ModifierBuilder<T>\n scrollPadding(\n padding:\n | number\n | string\n | {\n top?: number | string\n right?: number | string\n bottom?: number | string\n left?: number | string\n }\n ): ModifierBuilder<T>\n scrollSnap(\n type:\n | 'none'\n | 'x mandatory'\n | 'y mandatory'\n | 'x proximity'\n | 'y proximity'\n | 'both mandatory'\n | 'both proximity',\n align?: 'start' | 'end' | 'center',\n stop?: 'normal' | 'always'\n ): ModifierBuilder<T>\n\n // Lifecycle modifiers\n onAppear(handler: () => void): ModifierBuilder<T>\n onDisappear(handler: () => void): ModifierBuilder<T>\n task(\n operation: () => Promise<void> | void,\n options?: {\n id?: string\n priority?: 'background' | 'userInitiated' | 'utility' | 'default'\n }\n ): ModifierBuilder<T>\n refreshable(\n onRefresh: () => Promise<void>,\n isRefreshing?: boolean | Signal<boolean>\n ): ModifierBuilder<T>\n\n // Custom modifier application\n modifier(modifier: Modifier): ModifierBuilder<T>\n\n // Text case alias for textTransform\n textCase(\n value: 'none' | 'uppercase' | 'lowercase' | 'capitalize'\n ): ModifierBuilder<T>\n\n // HTML Content Rendering (Text components only)\n /**\n * Render component content as HTML instead of plain text\n *\n * ⚠️ **RESTRICTION**: Only available on Text components for security\n * ⚠️ **SECURITY NOTICE**: This modifier treats content as HTML.\n * - Default: Basic sanitization removes common XSS vectors\n * - Use skipSanitizer: true only with fully trusted content\n * - Consider DOMPurify for comprehensive sanitization\n * - Non-reactive for performance (content is processed once)\n *\n * @param options - Configuration options\n *\n * @example\n * ```typescript\n * // ✅ Allowed: Text components only\n * Text('<p>Hello <strong>world</strong></p>').modifier.asHTML().build()\n *\n * // ❌ Compile Error: Not a Text component\n * VStack({}).modifier.asHTML() // TypeScript error\n *\n * // ✅ Dangerous: Skip sanitization\n * Text(serverTemplate).modifier.asHTML({ skipSanitizer: true }).build()\n * ```\n */\n asHTML(options?: { skipSanitizer?: boolean }): ModifierBuilder<T>\n\n // Responsive functionality moved to @tachui/responsive package\n\n // Interaction modifiers\n onTap(handler: (event: MouseEvent) => void): ModifierBuilder<T>\n onFocus(handler: (isFocused: boolean) => void): ModifierBuilder<T>\n onBlur(handler: (isFocused: boolean) => void): ModifierBuilder<T>\n onKeyDown(handler: (event: KeyboardEvent) => void): ModifierBuilder<T>\n onScroll(handler: (event: Event) => void): ModifierBuilder<T>\n onKeyPress(handler: (event: KeyboardEvent) => void): ModifierBuilder<T>\n onKeyUp(handler: (event: KeyboardEvent) => void): ModifierBuilder<T>\n onDoubleClick(handler: (event: MouseEvent) => void): ModifierBuilder<T>\n onContextMenu(handler: (event: MouseEvent) => void): ModifierBuilder<T>\n onWheel(handler: (event: WheelEvent) => void): ModifierBuilder<T>\n onInput(handler: (event: InputEvent) => void): ModifierBuilder<T>\n onChange(handler: (value: any, event?: Event) => void): ModifierBuilder<T>\n onCopy(handler: (event: ClipboardEvent) => void): ModifierBuilder<T>\n onCut(handler: (event: ClipboardEvent) => void): ModifierBuilder<T>\n onPaste(handler: (event: ClipboardEvent) => void): ModifierBuilder<T>\n onSelect(handler: (event: Event) => void): ModifierBuilder<T>\n\n // Transition modifiers\n transition(\n property?: string,\n duration?: number,\n easing?: string,\n delay?: number\n ): ModifierBuilder<T>\n\n addModifier(modifier: Modifier): void\n\n // Build the final component with all modifiers applied\n build(): T\n}\n\n/**\n * Modifiable component - components that can have modifiers applied\n */\nexport interface ModifiableComponent<P extends ComponentProps = ComponentProps>\n extends ComponentInstance<P> {\n modifiers: Modifier[]\n modifierBuilder?: ModifierBuilder<ModifiableComponent<P>>\n}\n\n/**\n * CSS style properties that can be generated by modifiers\n */\nexport interface CSSStyleProperties {\n [property: string]:\n | string\n | number\n | Signal<string>\n | Signal<number>\n | undefined\n}\n\n/**\n * CSS class names that can be applied by modifiers\n */\nexport interface CSSClassNames {\n base?: string[]\n state?: Record<string, string[]>\n responsive?: Record<string, string[]>\n}\n\n/**\n * Modifier registry for registering custom modifiers\n */\nexport interface ModifierRegistry {\n register<TProps>(name: string, factory: ModifierFactory<TProps>): void\n get<TProps>(name: string): ModifierFactory<TProps> | undefined\n has(name: string): boolean\n list(): string[]\n}\n\n/**\n * Modifier application options\n */\nexport interface ModifierApplicationOptions {\n immediate?: boolean\n batch?: boolean\n suppressEffects?: boolean\n enableAnimations?: boolean\n}\n\n/**\n * Modifier priority levels for ordering\n */\nexport enum ModifierPriority {\n LAYOUT = 100,\n APPEARANCE = 200,\n INTERACTION = 300,\n ANIMATION = 400,\n CUSTOM = 500,\n}\n\n/**\n * Modifier application strategy\n */\nexport type ModifierApplicationStrategy =\n | 'sequential' // Apply modifiers one by one in order\n | 'batch' // Batch all style changes and apply at once\n | 'immediate' // Apply each modifier immediately\n\n/**\n * Style computation context for reactive styles\n */\nexport interface StyleComputationContext {\n componentId: string\n element: Element\n modifiers: Modifier[]\n signals: Set<Signal<any>>\n cleanup: (() => void)[]\n}\n"],"names":["ModifierPriority"],"mappings":"AAi9BO,IAAKA,sBAAAA,OACVA,EAAAA,EAAA,SAAS,GAAA,IAAT,UACAA,EAAAA,EAAA,aAAa,GAAA,IAAb,cACAA,EAAAA,EAAA,cAAc,GAAA,IAAd,eACAA,EAAAA,EAAA,YAAY,GAAA,IAAZ,aACAA,EAAAA,EAAA,SAAS,GAAA,IAAT,UALUA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Font Modifiers
|
|
3
|
+
*
|
|
4
|
+
* SwiftUI-style font configuration modifiers
|
|
5
|
+
*/
|
|
6
|
+
import { TypographyModifier, type FontStyle, type FontWeight } from './typography';
|
|
7
|
+
export interface FontOptions {
|
|
8
|
+
family?: string | any;
|
|
9
|
+
size?: number | string;
|
|
10
|
+
weight?: FontWeight | any;
|
|
11
|
+
style?: FontStyle;
|
|
12
|
+
}
|
|
13
|
+
export declare function font(options: FontOptions | string): TypographyModifier;
|
|
14
|
+
export declare function system(options: {
|
|
15
|
+
size?: number | string;
|
|
16
|
+
weight?: FontWeight | any;
|
|
17
|
+
design?: 'default' | 'serif' | 'rounded' | 'monospaced';
|
|
18
|
+
}): TypographyModifier;
|
|
19
|
+
export declare function custom(family: string | any, options?: {
|
|
20
|
+
size?: number | string;
|
|
21
|
+
weight?: FontWeight | any;
|
|
22
|
+
style?: FontStyle;
|
|
23
|
+
}): TypographyModifier;
|
|
24
|
+
//# sourceMappingURL=font.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"font.d.ts","sourceRoot":"","sources":["../../src/typography/font.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,kBAAkB,EAClB,KAAK,SAAS,EACd,KAAK,UAAU,EAChB,MAAM,cAAc,CAAA;AAErB,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;IACrB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACtB,MAAM,CAAC,EAAE,UAAU,GAAG,GAAG,CAAA;IACzB,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB;AAED,wBAAgB,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,GAAG,kBAAkB,CAWtE;AAyBD,wBAAgB,MAAM,CAAC,OAAO,EAAE;IAC9B,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACtB,MAAM,CAAC,EAAE,UAAU,GAAG,GAAG,CAAA;IACzB,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,YAAY,CAAA;CACxD,GAAG,kBAAkB,CAsBrB;AAED,wBAAgB,MAAM,CACpB,MAAM,EAAE,MAAM,GAAG,GAAG,EACpB,OAAO,CAAC,EAAE;IACR,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACtB,MAAM,CAAC,EAAE,UAAU,GAAG,GAAG,CAAA;IACzB,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB,GACA,kBAAkB,CAOpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/typography/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,cAAc,CAAA;AAC5B,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { T as o, k as t, j as r, i as s, f as i, d as f, e as p, l as n, o as l, s as h, a as d, h as m, c as y, g, b as w, t as x, w as c } from "../font-3qM2Z97N.js";
|
|
2
|
+
import { HyphensModifier as v, LineClampModifier as W, OverflowWrapModifier as k, WordBreakModifier as C, hyphens as S, lineClamp as T, overflowWrap as B, wordBreak as H } from "./text.js";
|
|
3
|
+
export {
|
|
4
|
+
v as HyphensModifier,
|
|
5
|
+
W as LineClampModifier,
|
|
6
|
+
k as OverflowWrapModifier,
|
|
7
|
+
o as TypographyModifier,
|
|
8
|
+
C as WordBreakModifier,
|
|
9
|
+
t as custom,
|
|
10
|
+
r as font,
|
|
11
|
+
s as fontFamily,
|
|
12
|
+
i as fontSize,
|
|
13
|
+
f as fontWeight,
|
|
14
|
+
S as hyphens,
|
|
15
|
+
p as letterSpacing,
|
|
16
|
+
T as lineClamp,
|
|
17
|
+
n as lineHeight,
|
|
18
|
+
l as overflow,
|
|
19
|
+
B as overflowWrap,
|
|
20
|
+
h as system,
|
|
21
|
+
d as textAlign,
|
|
22
|
+
m as textCase,
|
|
23
|
+
y as textDecoration,
|
|
24
|
+
g as textOverflow,
|
|
25
|
+
w as textTransform,
|
|
26
|
+
x as typography,
|
|
27
|
+
c as whiteSpace,
|
|
28
|
+
H as wordBreak
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text Modifiers Implementation
|
|
3
|
+
*
|
|
4
|
+
* Specialized text handling modifiers including line clamping, word breaking,
|
|
5
|
+
* overflow wrapping, and hyphenation control for enhanced typography.
|
|
6
|
+
*/
|
|
7
|
+
import type { DOMNode } from '@tachui/core/runtime/types';
|
|
8
|
+
import { BaseModifier } from '../basic/base';
|
|
9
|
+
import type { ModifierContext, ReactiveModifierProps } from '@tachui/core/modifiers/types';
|
|
10
|
+
export interface LineClampOptions {
|
|
11
|
+
lines: number;
|
|
12
|
+
}
|
|
13
|
+
export type ReactiveLineClampOptions = ReactiveModifierProps<LineClampOptions>;
|
|
14
|
+
export declare class LineClampModifier extends BaseModifier<LineClampOptions> {
|
|
15
|
+
readonly type = "lineClamp";
|
|
16
|
+
readonly priority: number;
|
|
17
|
+
apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined;
|
|
18
|
+
private generateLineClampStyles;
|
|
19
|
+
private validateLines;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Line clamp modifier function - SwiftUI .lineLimit() equivalent
|
|
23
|
+
*/
|
|
24
|
+
export declare function lineClamp(lines: number): LineClampModifier;
|
|
25
|
+
export type WordBreakValue = 'normal' | 'break-all' | 'keep-all' | 'break-word';
|
|
26
|
+
export interface WordBreakOptions {
|
|
27
|
+
wordBreak: WordBreakValue;
|
|
28
|
+
}
|
|
29
|
+
export type ReactiveWordBreakOptions = ReactiveModifierProps<WordBreakOptions>;
|
|
30
|
+
export declare class WordBreakModifier extends BaseModifier<WordBreakOptions> {
|
|
31
|
+
readonly type = "wordBreak";
|
|
32
|
+
readonly priority: number;
|
|
33
|
+
apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined;
|
|
34
|
+
private validateWordBreak;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Word break modifier function
|
|
38
|
+
*/
|
|
39
|
+
export declare function wordBreak(value: WordBreakValue): WordBreakModifier;
|
|
40
|
+
export type OverflowWrapValue = 'normal' | 'break-word' | 'anywhere';
|
|
41
|
+
export interface OverflowWrapOptions {
|
|
42
|
+
overflowWrap: OverflowWrapValue;
|
|
43
|
+
}
|
|
44
|
+
export type ReactiveOverflowWrapOptions = ReactiveModifierProps<OverflowWrapOptions>;
|
|
45
|
+
export declare class OverflowWrapModifier extends BaseModifier<OverflowWrapOptions> {
|
|
46
|
+
readonly type = "overflowWrap";
|
|
47
|
+
readonly priority: number;
|
|
48
|
+
apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined;
|
|
49
|
+
private validateOverflowWrap;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Overflow wrap modifier function
|
|
53
|
+
*/
|
|
54
|
+
export declare function overflowWrap(value: OverflowWrapValue): OverflowWrapModifier;
|
|
55
|
+
export type HyphensValue = 'none' | 'manual' | 'auto';
|
|
56
|
+
export interface HyphensOptions {
|
|
57
|
+
hyphens: HyphensValue;
|
|
58
|
+
}
|
|
59
|
+
export type ReactiveHyphensOptions = ReactiveModifierProps<HyphensOptions>;
|
|
60
|
+
export declare class HyphensModifier extends BaseModifier<HyphensOptions> {
|
|
61
|
+
readonly type = "hyphens";
|
|
62
|
+
readonly priority: number;
|
|
63
|
+
apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined;
|
|
64
|
+
private validateHyphens;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Hyphens modifier function
|
|
68
|
+
*/
|
|
69
|
+
export declare function hyphens(value: HyphensValue): HyphensModifier;
|
|
70
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/typography/text.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,EACV,eAAe,EACf,qBAAqB,EACtB,MAAM,8BAA8B,CAAA;AAOrC,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAA;CACd;AAED,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C9B,QAAQ,CAAC,QAAQ,SAAkC;IAEnD,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,GAAG,SAAS;IAepE,OAAO,CAAC,oBAAoB;CAa7B;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,oBAAoB,CAE3E;AAMD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAA;AAErD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,YAAY,CAAA;CACtB;AAED,MAAM,MAAM,sBAAsB,GAAG,qBAAqB,CAAC,cAAc,CAAC,CAAA;AAE1E,qBAAa,eAAgB,SAAQ,YAAY,CAAC,cAAc,CAAC;IAC/D,QAAQ,CAAC,IAAI,aAAY;IACzB,QAAQ,CAAC,QAAQ,SAAmC;IAEpD,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,GAAG,SAAS;IAoBpE,OAAO,CAAC,eAAe;CAexB;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,eAAe,CAE5D"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
var p = Object.defineProperty;
|
|
2
|
+
var d = (i, n, r) => n in i ? p(i, n, { enumerable: !0, configurable: !0, writable: !0, value: r }) : i[n] = r;
|
|
3
|
+
var a = (i, n, r) => d(i, typeof n != "symbol" ? n + "" : n, r);
|
|
4
|
+
import { B as t } from "../base-CkGf4b9G.js";
|
|
5
|
+
import { ModifierPriority as s } from "@tachui/core/modifiers/types";
|
|
6
|
+
class f extends t {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
a(this, "type", "lineClamp");
|
|
10
|
+
a(this, "priority", s.APPEARANCE + 15);
|
|
11
|
+
}
|
|
12
|
+
apply(r, e) {
|
|
13
|
+
if (!e.element) return;
|
|
14
|
+
const { lines: o } = this.properties;
|
|
15
|
+
process.env.NODE_ENV === "development" && this.validateLines(o);
|
|
16
|
+
const l = this.generateLineClampStyles(o);
|
|
17
|
+
this.applyStyles(e.element, l);
|
|
18
|
+
}
|
|
19
|
+
generateLineClampStyles(r) {
|
|
20
|
+
const e = {};
|
|
21
|
+
return e.display = "-webkit-box", e.webkitLineClamp = String(r), e.webkitBoxOrient = "vertical", e.overflow = "hidden", e.textOverflow = "ellipsis", e.wordWrap = "break-word", e;
|
|
22
|
+
}
|
|
23
|
+
validateLines(r) {
|
|
24
|
+
if (typeof r != "number" || !Number.isInteger(r) || r < 1) {
|
|
25
|
+
console.warn(
|
|
26
|
+
"TachUI LineClamp Modifier: lines must be a positive integer"
|
|
27
|
+
);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
r > 10 && console.info(
|
|
31
|
+
"TachUI LineClamp Modifier: Large line clamp values (>10) may impact readability. Consider if this is intentional."
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function m(i) {
|
|
36
|
+
return new f({ lines: i });
|
|
37
|
+
}
|
|
38
|
+
class h extends t {
|
|
39
|
+
constructor() {
|
|
40
|
+
super(...arguments);
|
|
41
|
+
a(this, "type", "wordBreak");
|
|
42
|
+
a(this, "priority", s.APPEARANCE + 8);
|
|
43
|
+
}
|
|
44
|
+
apply(r, e) {
|
|
45
|
+
if (!e.element) return;
|
|
46
|
+
const { wordBreak: o } = this.properties;
|
|
47
|
+
process.env.NODE_ENV === "development" && this.validateWordBreak(o), this.applyStyles(e.element, { wordBreak: o });
|
|
48
|
+
}
|
|
49
|
+
validateWordBreak(r) {
|
|
50
|
+
const e = [
|
|
51
|
+
"normal",
|
|
52
|
+
"break-all",
|
|
53
|
+
"keep-all",
|
|
54
|
+
"break-word"
|
|
55
|
+
];
|
|
56
|
+
e.includes(r) || console.warn(
|
|
57
|
+
`TachUI WordBreak Modifier: Invalid word-break value "${r}". Valid values are: ${e.join(", ")}`
|
|
58
|
+
), r === "break-word" && console.info(
|
|
59
|
+
'TachUI WordBreak Modifier: "break-word" is deprecated. Consider using overflowWrap("break-word") instead.'
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function k(i) {
|
|
64
|
+
return new h({ wordBreak: i });
|
|
65
|
+
}
|
|
66
|
+
class y extends t {
|
|
67
|
+
constructor() {
|
|
68
|
+
super(...arguments);
|
|
69
|
+
a(this, "type", "overflowWrap");
|
|
70
|
+
a(this, "priority", s.APPEARANCE + 9);
|
|
71
|
+
}
|
|
72
|
+
apply(r, e) {
|
|
73
|
+
if (!e.element) return;
|
|
74
|
+
const { overflowWrap: o } = this.properties;
|
|
75
|
+
process.env.NODE_ENV === "development" && this.validateOverflowWrap(o), this.applyStyles(e.element, { overflowWrap: o });
|
|
76
|
+
}
|
|
77
|
+
validateOverflowWrap(r) {
|
|
78
|
+
const e = [
|
|
79
|
+
"normal",
|
|
80
|
+
"break-word",
|
|
81
|
+
"anywhere"
|
|
82
|
+
];
|
|
83
|
+
e.includes(r) || console.warn(
|
|
84
|
+
`TachUI OverflowWrap Modifier: Invalid overflow-wrap value "${r}". Valid values are: ${e.join(", ")}`
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function b(i) {
|
|
89
|
+
return new y({ overflowWrap: i });
|
|
90
|
+
}
|
|
91
|
+
class v extends t {
|
|
92
|
+
constructor() {
|
|
93
|
+
super(...arguments);
|
|
94
|
+
a(this, "type", "hyphens");
|
|
95
|
+
a(this, "priority", s.APPEARANCE + 10);
|
|
96
|
+
}
|
|
97
|
+
apply(r, e) {
|
|
98
|
+
if (!e.element) return;
|
|
99
|
+
const { hyphens: o } = this.properties;
|
|
100
|
+
process.env.NODE_ENV === "development" && this.validateHyphens(o), this.applyStyles(e.element, {
|
|
101
|
+
hyphens: o,
|
|
102
|
+
// Add vendor prefixes for better browser support
|
|
103
|
+
webkitHyphens: o,
|
|
104
|
+
msHyphens: o
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
validateHyphens(r) {
|
|
108
|
+
const e = ["none", "manual", "auto"];
|
|
109
|
+
e.includes(r) || console.warn(
|
|
110
|
+
`TachUI Hyphens Modifier: Invalid hyphens value "${r}". Valid values are: ${e.join(", ")}`
|
|
111
|
+
), r === "auto" && console.info(
|
|
112
|
+
"TachUI Hyphens Modifier: Automatic hyphenation requires proper lang attribute on the document or element for best results."
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function W(i) {
|
|
117
|
+
return new v({ hyphens: i });
|
|
118
|
+
}
|
|
119
|
+
export {
|
|
120
|
+
v as HyphensModifier,
|
|
121
|
+
f as LineClampModifier,
|
|
122
|
+
y as OverflowWrapModifier,
|
|
123
|
+
h as WordBreakModifier,
|
|
124
|
+
W as hyphens,
|
|
125
|
+
m as lineClamp,
|
|
126
|
+
b as overflowWrap,
|
|
127
|
+
k as wordBreak
|
|
128
|
+
};
|
|
129
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","sources":["../../src/typography/text.ts"],"sourcesContent":["/**\n * Text Modifiers Implementation\n *\n * Specialized text handling modifiers including line clamping, word breaking,\n * overflow wrapping, and hyphenation control for enhanced typography.\n */\n\nimport type { DOMNode } from '@tachui/core/runtime/types'\nimport { BaseModifier } from '../basic/base'\nimport type {\n ModifierContext,\n ReactiveModifierProps,\n} from '@tachui/core/modifiers/types'\nimport { ModifierPriority } from '@tachui/core/modifiers/types'\n\n// ============================================================================\n// Line Clamp Modifier - Multi-line Text Truncation\n// ============================================================================\n\nexport interface LineClampOptions {\n lines: number\n}\n\nexport type ReactiveLineClampOptions = ReactiveModifierProps<LineClampOptions>\n\nexport class LineClampModifier extends BaseModifier<LineClampOptions> {\n readonly type = 'lineClamp'\n readonly priority = ModifierPriority.APPEARANCE + 15\n\n apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined {\n if (!context.element) return\n\n const { lines } = this.properties\n\n // Validate lines in development mode\n if (process.env.NODE_ENV === 'development') {\n this.validateLines(lines)\n }\n\n // Apply line clamp styles\n const styles = this.generateLineClampStyles(lines)\n this.applyStyles(context.element, styles)\n\n return undefined\n }\n\n private generateLineClampStyles(lines: number): Record<string, string> {\n const styles: Record<string, string> = {}\n\n // Modern browsers: Use -webkit-line-clamp\n styles.display = '-webkit-box'\n styles.webkitLineClamp = String(lines)\n styles.webkitBoxOrient = 'vertical'\n styles.overflow = 'hidden'\n\n // Additional properties for better cross-browser support\n styles.textOverflow = 'ellipsis'\n styles.wordWrap = 'break-word'\n\n return styles\n }\n\n private validateLines(lines: number): void {\n if (typeof lines !== 'number' || !Number.isInteger(lines) || lines < 1) {\n console.warn(\n 'TachUI LineClamp Modifier: lines must be a positive integer'\n )\n return\n }\n\n if (lines > 10) {\n console.info(\n 'TachUI LineClamp Modifier: Large line clamp values (>10) may impact readability. Consider if this is intentional.'\n )\n }\n }\n}\n\n/**\n * Line clamp modifier function - SwiftUI .lineLimit() equivalent\n */\nexport function lineClamp(lines: number): LineClampModifier {\n return new LineClampModifier({ lines })\n}\n\n// ============================================================================\n// Word Break Modifier - Word Breaking Behavior\n// ============================================================================\n\nexport type WordBreakValue = 'normal' | 'break-all' | 'keep-all' | 'break-word'\n\nexport interface WordBreakOptions {\n wordBreak: WordBreakValue\n}\n\nexport type ReactiveWordBreakOptions = ReactiveModifierProps<WordBreakOptions>\n\nexport class WordBreakModifier extends BaseModifier<WordBreakOptions> {\n readonly type = 'wordBreak'\n readonly priority = ModifierPriority.APPEARANCE + 8\n\n apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined {\n if (!context.element) return\n\n const { wordBreak } = this.properties\n\n // Validate word break value in development mode\n if (process.env.NODE_ENV === 'development') {\n this.validateWordBreak(wordBreak)\n }\n\n this.applyStyles(context.element, { wordBreak })\n\n return undefined\n }\n\n private validateWordBreak(value: string): void {\n const validValues: WordBreakValue[] = [\n 'normal',\n 'break-all',\n 'keep-all',\n 'break-word',\n ]\n\n if (!validValues.includes(value as WordBreakValue)) {\n console.warn(\n `TachUI WordBreak Modifier: Invalid word-break value \"${value}\". Valid values are: ${validValues.join(', ')}`\n )\n }\n\n if (value === 'break-word') {\n console.info(\n 'TachUI WordBreak Modifier: \"break-word\" is deprecated. Consider using overflowWrap(\"break-word\") instead.'\n )\n }\n }\n}\n\n/**\n * Word break modifier function\n */\nexport function wordBreak(value: WordBreakValue): WordBreakModifier {\n return new WordBreakModifier({ wordBreak: value })\n}\n\n// ============================================================================\n// Overflow Wrap Modifier - Word Wrapping\n// ============================================================================\n\nexport type OverflowWrapValue = 'normal' | 'break-word' | 'anywhere'\n\nexport interface OverflowWrapOptions {\n overflowWrap: OverflowWrapValue\n}\n\nexport type ReactiveOverflowWrapOptions =\n ReactiveModifierProps<OverflowWrapOptions>\n\nexport class OverflowWrapModifier extends BaseModifier<OverflowWrapOptions> {\n readonly type = 'overflowWrap'\n readonly priority = ModifierPriority.APPEARANCE + 9\n\n apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined {\n if (!context.element) return\n\n const { overflowWrap } = this.properties\n\n // Validate overflow wrap value in development mode\n if (process.env.NODE_ENV === 'development') {\n this.validateOverflowWrap(overflowWrap)\n }\n\n this.applyStyles(context.element, { overflowWrap })\n\n return undefined\n }\n\n private validateOverflowWrap(value: string): void {\n const validValues: OverflowWrapValue[] = [\n 'normal',\n 'break-word',\n 'anywhere',\n ]\n\n if (!validValues.includes(value as OverflowWrapValue)) {\n console.warn(\n `TachUI OverflowWrap Modifier: Invalid overflow-wrap value \"${value}\". Valid values are: ${validValues.join(', ')}`\n )\n }\n }\n}\n\n/**\n * Overflow wrap modifier function\n */\nexport function overflowWrap(value: OverflowWrapValue): OverflowWrapModifier {\n return new OverflowWrapModifier({ overflowWrap: value })\n}\n\n// ============================================================================\n// Hyphens Modifier - Hyphenation Control\n// ============================================================================\n\nexport type HyphensValue = 'none' | 'manual' | 'auto'\n\nexport interface HyphensOptions {\n hyphens: HyphensValue\n}\n\nexport type ReactiveHyphensOptions = ReactiveModifierProps<HyphensOptions>\n\nexport class HyphensModifier extends BaseModifier<HyphensOptions> {\n readonly type = 'hyphens'\n readonly priority = ModifierPriority.APPEARANCE + 10\n\n apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined {\n if (!context.element) return\n\n const { hyphens } = this.properties\n\n // Validate hyphens value in development mode\n if (process.env.NODE_ENV === 'development') {\n this.validateHyphens(hyphens)\n }\n\n this.applyStyles(context.element, {\n hyphens,\n // Add vendor prefixes for better browser support\n webkitHyphens: hyphens,\n msHyphens: hyphens,\n })\n\n return undefined\n }\n\n private validateHyphens(value: string): void {\n const validValues: HyphensValue[] = ['none', 'manual', 'auto']\n\n if (!validValues.includes(value as HyphensValue)) {\n console.warn(\n `TachUI Hyphens Modifier: Invalid hyphens value \"${value}\". Valid values are: ${validValues.join(', ')}`\n )\n }\n\n if (value === 'auto') {\n console.info(\n 'TachUI Hyphens Modifier: Automatic hyphenation requires proper lang attribute on the document or element for best results.'\n )\n }\n }\n}\n\n/**\n * Hyphens modifier function\n */\nexport function hyphens(value: HyphensValue): HyphensModifier {\n return new HyphensModifier({ hyphens: value })\n}\n\n// Note: Background clip modifiers are already available in the appearance package\n// Import them from @tachui/modifiers/appearance for gradient text effects\n"],"names":["LineClampModifier","BaseModifier","__publicField","ModifierPriority","_node","context","lines","styles","lineClamp","WordBreakModifier","wordBreak","value","validValues","OverflowWrapModifier","overflowWrap","HyphensModifier","hyphens"],"mappings":";;;;;AAyBO,MAAMA,UAA0BC,EAA+B;AAAA,EAA/D;AAAA;AACI,IAAAC,EAAA,cAAO;AACP,IAAAA,EAAA,kBAAWC,EAAiB,aAAa;AAAA;AAAA,EAElD,MAAMC,GAAgBC,GAA+C;AACnE,QAAI,CAACA,EAAQ,QAAS;AAEtB,UAAM,EAAE,OAAAC,MAAU,KAAK;AAGvB,IAAI,QAAQ,IAAI,aAAa,iBAC3B,KAAK,cAAcA,CAAK;AAI1B,UAA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;AAC3C,UAAMC,IAA8B,CAAC,QAAQ,UAAU,MAAM;AAE7D,IAAKA,EAAY,SAASD,CAAqB,KAC7C,QAAQ;AAAA,MACN,mDAAmDA,CAAK,wBAAwBC,EAAY,KAAK,IAAI,CAAC;AAAA,IAAA,GAItGD,MAAU,UACZ,QAAQ;AAAA,MACN;AAAA,IAAA;AAAA,EAGN;AACF;AAKO,SAASK,EAAQL,GAAsC;AAC5D,SAAO,IAAII,EAAgB,EAAE,SAASJ,GAAO;AAC/C;"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typography Modifiers
|
|
3
|
+
*
|
|
4
|
+
* Comprehensive text styling modifiers
|
|
5
|
+
*/
|
|
6
|
+
import { BaseModifier } from '../basic/base';
|
|
7
|
+
import type { ModifierContext, FontWeight } from '@tachui/core/modifiers/types';
|
|
8
|
+
import type { DOMNode } from '@tachui/core/runtime/types';
|
|
9
|
+
export type { FontWeight };
|
|
10
|
+
export type TextAlign = 'left' | 'center' | 'right' | 'justify' | 'start' | 'end';
|
|
11
|
+
export type TextTransform = 'none' | 'uppercase' | 'lowercase' | 'capitalize';
|
|
12
|
+
export type TextDecoration = 'none' | 'underline' | 'overline' | 'line-through';
|
|
13
|
+
export type FontVariant = 'normal' | 'small-caps';
|
|
14
|
+
export type FontStyle = 'normal' | 'italic' | 'oblique';
|
|
15
|
+
export interface TypographyOptions {
|
|
16
|
+
size?: number | string;
|
|
17
|
+
weight?: FontWeight | number;
|
|
18
|
+
family?: string | any;
|
|
19
|
+
lineHeight?: number | string;
|
|
20
|
+
letterSpacing?: number | string;
|
|
21
|
+
wordSpacing?: number | string;
|
|
22
|
+
align?: TextAlign;
|
|
23
|
+
transform?: TextTransform;
|
|
24
|
+
decoration?: TextDecoration;
|
|
25
|
+
variant?: FontVariant;
|
|
26
|
+
style?: FontStyle;
|
|
27
|
+
color?: string;
|
|
28
|
+
textOverflow?: 'clip' | 'ellipsis' | 'fade' | string;
|
|
29
|
+
whiteSpace?: 'normal' | 'nowrap' | 'pre' | 'pre-wrap' | 'pre-line' | 'break-spaces';
|
|
30
|
+
overflow?: 'visible' | 'hidden' | 'scroll' | 'auto';
|
|
31
|
+
}
|
|
32
|
+
export declare class TypographyModifier extends BaseModifier<TypographyOptions> {
|
|
33
|
+
readonly type = "typography";
|
|
34
|
+
readonly priority = 30;
|
|
35
|
+
apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined;
|
|
36
|
+
private computeTypographyStyles;
|
|
37
|
+
protected toCSSValue(value: number | string): string;
|
|
38
|
+
}
|
|
39
|
+
export declare function typography(options: TypographyOptions): TypographyModifier;
|
|
40
|
+
export declare function textAlign(value: TextAlign): TypographyModifier;
|
|
41
|
+
export declare function textTransform(value: TextTransform): TypographyModifier;
|
|
42
|
+
export declare function textDecoration(value: TextDecoration): TypographyModifier;
|
|
43
|
+
export declare function fontSize(value: number | string): TypographyModifier;
|
|
44
|
+
export declare function fontWeight(value: FontWeight | number): TypographyModifier;
|
|
45
|
+
export declare function lineHeight(value: number | string): TypographyModifier;
|
|
46
|
+
export declare function letterSpacing(value: number | string): TypographyModifier;
|
|
47
|
+
export declare function textOverflow(value: 'clip' | 'ellipsis' | 'fade' | string): TypographyModifier;
|
|
48
|
+
export declare function whiteSpace(value: 'normal' | 'nowrap' | 'pre' | 'pre-wrap' | 'pre-line' | 'break-spaces'): TypographyModifier;
|
|
49
|
+
export declare function overflow(value: 'visible' | 'hidden' | 'scroll' | 'auto'): TypographyModifier;
|
|
50
|
+
export declare function textCase(value: TextTransform): TypographyModifier;
|
|
51
|
+
export declare function fontFamily(value: string | any): TypographyModifier;
|
|
52
|
+
//# sourceMappingURL=typography.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../src/typography/typography.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,KAA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SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAC9C,kBAAkB,CAEpB;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,kBAAkB,CAEjE;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,kBAAkB,CAElE"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSS Modifier - raw CSS properties
|
|
3
|
+
*
|
|
4
|
+
* Provides an escape hatch for applying raw CSS properties
|
|
5
|
+
* that may not have dedicated modifiers yet, or for experimental
|
|
6
|
+
* CSS features.
|
|
7
|
+
*/
|
|
8
|
+
import type { DOMNode } from '@tachui/core/runtime/types';
|
|
9
|
+
import { BaseModifier } from '../basic/base';
|
|
10
|
+
import type { ModifierContext, ReactiveModifierProps } from '@tachui/core/modifiers/types';
|
|
11
|
+
export interface CSSOptions {
|
|
12
|
+
[property: string]: string | number | undefined;
|
|
13
|
+
}
|
|
14
|
+
export type ReactiveCSSOptions = ReactiveModifierProps<CSSOptions>;
|
|
15
|
+
export declare class CSSModifier extends BaseModifier<CSSOptions> {
|
|
16
|
+
readonly type = "css";
|
|
17
|
+
readonly priority = 5;
|
|
18
|
+
constructor(options: ReactiveCSSOptions);
|
|
19
|
+
apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined;
|
|
20
|
+
private computeCSSStyles;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Create a CSS modifier with raw CSS properties
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* // Apply raw CSS properties
|
|
28
|
+
* .css({
|
|
29
|
+
* backdropFilter: 'blur(10px)',
|
|
30
|
+
* maskImage: 'linear-gradient(to bottom, black, transparent)',
|
|
31
|
+
* scrollBehavior: 'smooth',
|
|
32
|
+
* containerType: 'inline-size'
|
|
33
|
+
* })
|
|
34
|
+
*
|
|
35
|
+
* // Mix camelCase and kebab-case (both work)
|
|
36
|
+
* .css({
|
|
37
|
+
* backgroundColor: 'red', // camelCase (recommended)
|
|
38
|
+
* 'background-color': 'red', // kebab-case (also works)
|
|
39
|
+
* WebkitTransform: 'scale(1.1)', // vendor prefixes
|
|
40
|
+
* '--custom-property': '42px' // CSS custom properties
|
|
41
|
+
* })
|
|
42
|
+
*
|
|
43
|
+
* // Experimental CSS features
|
|
44
|
+
* .css({
|
|
45
|
+
* aspectRatio: '16/9',
|
|
46
|
+
* scrollSnapType: 'y mandatory',
|
|
47
|
+
* containIntrinsicSize: '300px',
|
|
48
|
+
* accentColor: '#007AFF'
|
|
49
|
+
* })
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare function css(properties: ReactiveCSSOptions): CSSModifier;
|
|
53
|
+
/**
|
|
54
|
+
* Convenience function for setting a single CSS property
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* .cssProperty('backdrop-filter', 'blur(10px)')
|
|
59
|
+
* .cssProperty('scrollBehavior', 'smooth')
|
|
60
|
+
* .cssProperty('aspectRatio', '16/9')
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare function cssProperty(property: string, value: string | number): CSSModifier;
|
|
64
|
+
/**
|
|
65
|
+
* Convenience function for CSS custom properties (CSS variables)
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* .cssVariable('primary-color', '#007AFF')
|
|
70
|
+
* .cssVariable('spacing-unit', '8px')
|
|
71
|
+
* .cssVariable('border-radius', '12px')
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export declare function cssVariable(name: string, value: string | number): CSSModifier;
|
|
75
|
+
/**
|
|
76
|
+
* Convenience function for vendor-prefixed properties
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```typescript
|
|
80
|
+
* .cssVendor('webkit', 'transform', 'scale(1.1)')
|
|
81
|
+
* .cssVendor('moz', 'user-select', 'none')
|
|
82
|
+
* .cssVendor('ms', 'filter', 'blur(5px)')
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
export declare function cssVendor(prefix: 'webkit' | 'moz' | 'ms' | 'o', property: string, value: string | number): CSSModifier;
|
|
86
|
+
//# sourceMappingURL=css.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../src/utility/css.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,EACV,eAAe,EACf,qBAAqB,EACtB,MAAM,8BAA8B,CAAA;AAErC,MAAM,WAAW,UAAU;IACzB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CAChD;AAED,MAAM,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAA;AAElE,qBAAa,WAAY,SAAQ,YAAY,CAAC,UAAU,CAAC;IACvD,QAAQ,CAAC,IAAI,SAAQ;IACrB,QAAQ,CAAC,QAAQ,KAAI;gBAET,OAAO,EAAE,kBAAkB;IAavC,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,GAAG,SAAS;IASpE,OAAO,CAAC,gBAAgB;CAazB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,GAAG,CAAC,UAAU,EAAE,kBAAkB,GAAG,WAAW,CAE/D;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GAAG,MAAM,GACrB,WAAW,CAEb;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,WAAW,CAI7E;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,QAAQ,GAAG,KAAK,GAAG,IAAI,GAAG,GAAG,EACrC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GAAG,MAAM,GACrB,WAAW,CAWb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utility/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,WAAW,CAAA;AACzB,cAAc,OAAO,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { C as o, U as i, f as e, g as r, h as t, i as f, c as l, d as c, b as d, e as u, a as y, o as n, u as p } from "../css-CJEXRr6H.js";
|
|
2
|
+
export {
|
|
3
|
+
o as CSSModifier,
|
|
4
|
+
i as UtilityModifier,
|
|
5
|
+
e as css,
|
|
6
|
+
r as cssProperty,
|
|
7
|
+
t as cssVariable,
|
|
8
|
+
f as cssVendor,
|
|
9
|
+
l as cursor,
|
|
10
|
+
c as display,
|
|
11
|
+
d as outline,
|
|
12
|
+
u as outlineOffset,
|
|
13
|
+
y as overflowX,
|
|
14
|
+
n as overflowY,
|
|
15
|
+
p as utility
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility Modifier - miscellaneous CSS properties
|
|
3
|
+
*
|
|
4
|
+
* Provides access to various CSS properties that don't fit
|
|
5
|
+
* into other specific modifier categories.
|
|
6
|
+
*/
|
|
7
|
+
import type { DOMNode } from '@tachui/core/runtime/types';
|
|
8
|
+
import { BaseModifier } from '../basic/base';
|
|
9
|
+
import type { ModifierContext, ReactiveModifierProps } from '@tachui/core/modifiers/types';
|
|
10
|
+
export interface UtilityOptions {
|
|
11
|
+
cursor?: 'auto' | 'default' | 'pointer' | 'text' | 'wait' | 'help' | 'not-allowed' | 'none' | 'grab' | 'grabbing' | 'zoom-in' | 'zoom-out' | 'alias' | 'cell' | 'copy' | string;
|
|
12
|
+
overflow?: 'visible' | 'hidden' | 'scroll' | 'auto';
|
|
13
|
+
overflowX?: 'visible' | 'hidden' | 'scroll' | 'auto';
|
|
14
|
+
overflowY?: 'visible' | 'hidden' | 'scroll' | 'auto';
|
|
15
|
+
position?: 'static' | 'relative' | 'absolute' | 'fixed' | 'sticky';
|
|
16
|
+
top?: number | string;
|
|
17
|
+
right?: number | string;
|
|
18
|
+
bottom?: number | string;
|
|
19
|
+
left?: number | string;
|
|
20
|
+
zIndex?: number;
|
|
21
|
+
display?: 'block' | 'inline' | 'inline-block' | 'flex' | 'inline-flex' | 'grid' | 'none';
|
|
22
|
+
visibility?: 'visible' | 'hidden' | 'collapse';
|
|
23
|
+
pointerEvents?: 'auto' | 'none';
|
|
24
|
+
userSelect?: 'auto' | 'none' | 'text' | 'all';
|
|
25
|
+
boxSizing?: 'content-box' | 'border-box';
|
|
26
|
+
objectFit?: 'fill' | 'contain' | 'cover' | 'none' | 'scale-down';
|
|
27
|
+
objectPosition?: string;
|
|
28
|
+
resize?: 'none' | 'both' | 'horizontal' | 'vertical';
|
|
29
|
+
outline?: string;
|
|
30
|
+
outlineOffset?: number | string;
|
|
31
|
+
}
|
|
32
|
+
export type ReactiveUtilityOptions = ReactiveModifierProps<UtilityOptions>;
|
|
33
|
+
export declare class UtilityModifier extends BaseModifier<UtilityOptions> {
|
|
34
|
+
readonly type = "utility";
|
|
35
|
+
readonly priority = 10;
|
|
36
|
+
constructor(options: ReactiveUtilityOptions);
|
|
37
|
+
apply(_node: DOMNode, context: ModifierContext): DOMNode | undefined;
|
|
38
|
+
private computeUtilityStyles;
|
|
39
|
+
private validateCursorValue;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Create a utility modifier with miscellaneous CSS properties
|
|
43
|
+
*/
|
|
44
|
+
export declare function utility(options: ReactiveUtilityOptions): UtilityModifier;
|
|
45
|
+
/**
|
|
46
|
+
* Convenience function for cursor
|
|
47
|
+
*/
|
|
48
|
+
export declare function cursor(value: UtilityOptions['cursor']): UtilityModifier;
|
|
49
|
+
/**
|
|
50
|
+
* Convenience function for overflow-y
|
|
51
|
+
*/
|
|
52
|
+
export declare function overflowY(value: UtilityOptions['overflowY']): UtilityModifier;
|
|
53
|
+
/**
|
|
54
|
+
* Convenience function for overflow-x
|
|
55
|
+
*/
|
|
56
|
+
export declare function overflowX(value: UtilityOptions['overflowX']): UtilityModifier;
|
|
57
|
+
/**
|
|
58
|
+
* Convenience function for display
|
|
59
|
+
*/
|
|
60
|
+
export declare function display(value: UtilityOptions['display']): UtilityModifier;
|
|
61
|
+
/**
|
|
62
|
+
* Convenience function for outline
|
|
63
|
+
*/
|
|
64
|
+
export declare function outline(value: string): UtilityModifier;
|
|
65
|
+
/**
|
|
66
|
+
* Convenience function for outline-offset
|
|
67
|
+
*/
|
|
68
|
+
export declare function outlineOffset(value: number | string): UtilityModifier;
|
|
69
|
+
//# sourceMappingURL=utility.d.ts.map
|