@womp/kookie-ui 0.29.0 → 0.29.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/components.css +17 -11
- package/dist/cjs/components/index.js +2 -2
- package/dist/cjs/components/index.js.map +3 -3
- package/dist/cjs/components/select.d.ts.map +1 -1
- package/dist/cjs/components/select.js +1 -1
- package/dist/cjs/components/select.js.map +3 -3
- package/dist/cjs/components/text-field.d.ts.map +1 -1
- package/dist/cjs/components/text-field.js +2 -2
- package/dist/cjs/components/text-field.js.map +3 -3
- package/dist/cjs/components/text-field.props.d.ts +4 -1
- package/dist/cjs/components/text-field.props.d.ts.map +1 -1
- package/dist/cjs/components/text-field.props.js.map +1 -1
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/index.js.map +3 -3
- package/dist/cjs/props/index.js.map +1 -1
- package/dist/esm/chunk-676Y7ZUT.js +3 -0
- package/dist/esm/chunk-676Y7ZUT.js.map +7 -0
- package/dist/esm/{chunk-FIMFM25N.js → chunk-EXF5SF27.js} +1 -1
- package/dist/esm/{chunk-FIMFM25N.js.map → chunk-EXF5SF27.js.map} +1 -1
- package/dist/esm/chunk-K5V53KTJ.js +6 -0
- package/dist/esm/chunk-K5V53KTJ.js.map +7 -0
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/select.d.ts.map +1 -1
- package/dist/esm/components/select.js +1 -1
- package/dist/esm/components/text-field.d.ts.map +1 -1
- package/dist/esm/components/text-field.js +1 -1
- package/dist/esm/components/text-field.props.d.ts +4 -1
- package/dist/esm/components/text-field.props.d.ts.map +1 -1
- package/dist/esm/components/text-field.props.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/props/index.js +1 -1
- package/package.json +1 -1
- package/src/components/segmented-control.css +1 -1
- package/src/components/select.css +4 -4
- package/src/components/select.tsx +15 -1
- package/src/components/text-area.css +2 -2
- package/src/components/text-field.css +11 -4
- package/src/components/text-field.props.tsx +4 -1
- package/src/components/text-field.tsx +66 -86
- package/src/styles/tokens/shadow.css +7 -2
- package/styles.css +19 -11
- package/tokens/base.css +2 -0
- package/tokens.css +2 -0
- package/dist/esm/chunk-GPZHRZBE.js +0 -6
- package/dist/esm/chunk-GPZHRZBE.js.map +0 -7
- package/dist/esm/chunk-VQDCHBZR.js +0 -3
- package/dist/esm/chunk-VQDCHBZR.js.map +0 -7
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/select.tsx", "../../src/components/select.props.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Select as SelectPrimitive, ScrollArea as ScrollAreaPrimitive } from 'radix-ui';\nimport { useComposedRefs, useLayoutEffect } from 'radix-ui/internal';\n\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSize } from '../hooks/theme-size.js';\nimport { ChevronDownIcon, ThickCheckIcon } from './icons.js';\nimport { Spinner } from './spinner.js';\nimport {\n selectRootPropDefs,\n selectTriggerPropDefs,\n selectContentPropDefs,\n} from './select.props.js';\nimport { useThemeContext } from './theme.js';\nimport { PortalTheme } from './_internal/portal-theme.js';\nimport { useThumbSync } from '../hooks/use-thumb-sync.js';\n\nimport type { GetPropDefTypes } from '../props/prop-def.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\ntype SelectRootOwnProps = GetPropDefTypes<typeof selectRootPropDefs>;\n\n// Trigger and Content pass the size prop def as its own record. It is hoisted because\n// extractProps caches its compiled prop defs on the identity of each record it is given:\n// a literal written at the call site would be a new object, and a recompile, every render.\nconst selectSizePropDefs = { size: selectRootPropDefs.size };\n\n// Keys that open the list from the trigger, as in Radix.\nconst OPEN_KEYS = [' ', 'Enter', 'ArrowUp', 'ArrowDown'];\n\ninterface SelectContextValue extends SelectRootOwnProps {\n /** Whether the list is open. Undefined when Content is rendered outside a Kookie Select.Root. */\n open?: boolean;\n}\nconst SelectContext = React.createContext<SelectContextValue>({});\n\ninterface SelectRootProps extends SelectPrimitive.SelectProps, SelectRootOwnProps {}\nconst SelectRoot: React.FC<SelectRootProps> = (props) => {\n const {\n children,\n size: sizeProp,\n open: openProp,\n defaultOpen,\n onOpenChange,\n ...rootProps\n } = props;\n const size = useThemeSize(sizeProp, selectRootPropDefs.size);\n\n // Root owns the open state and hands Radix a controlled `open`, so Content learns of a\n // change in the same render Radix does. Radix's uncontrolled state reports changes from an\n // effect, a render late, which would mount the open list once without its wrappers.\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen ?? false);\n const open = openProp ?? uncontrolledOpen;\n const handleOpenChange = React.useCallback(\n (next: boolean) => {\n setUncontrolledOpen(next);\n onOpenChange?.(next);\n },\n [onOpenChange],\n );\n\n return (\n <SelectPrimitive.Root {...rootProps} open={open} onOpenChange={handleOpenChange}>\n <SelectContext.Provider value={React.useMemo(() => ({ size, open }), [size, open])}>\n {children}\n </SelectContext.Provider>\n </SelectPrimitive.Root>\n );\n};\nSelectRoot.displayName = 'Select.Root';\n\ntype SelectTriggerElement = React.ElementRef<typeof SelectPrimitive.Trigger>;\ntype SelectTriggerOwnProps = GetPropDefTypes<typeof selectTriggerPropDefs>;\ninterface SelectTriggerProps\n extends ComponentPropsWithout<typeof SelectPrimitive.Trigger, RemovedProps>,\n SelectTriggerOwnProps {}\nconst SelectTrigger = React.forwardRef<SelectTriggerElement, SelectTriggerProps>(\n (props, forwardedRef) => {\n const context = React.useContext(SelectContext);\n const {\n children,\n className,\n color,\n radius,\n placeholder,\n error,\n loading,\n disabled,\n readOnly,\n ...triggerProps\n } = extractProps(\n // Pass size value from the context to generate styles\n { size: context?.size, ...props },\n // Pass size prop def to allow it to be extracted\n selectSizePropDefs,\n selectTriggerPropDefs,\n );\n\n // The props win when set; otherwise a caller's own aria-* (a form library's aria-invalid)\n // stays, so both paths reach the accessibility tree and the CSS, as on TextField.\n const {\n 'aria-invalid': ariaInvalid,\n 'aria-busy': ariaBusy,\n 'aria-disabled': ariaDisabled,\n 'aria-readonly': ariaReadOnly,\n } = triggerProps;\n const isInvalid = Boolean(error) || ariaInvalid === true || ariaInvalid === 'true';\n const ariaProps = React.useMemo(\n () => ({\n 'aria-invalid': isInvalid ? true : ariaInvalid,\n 'aria-busy': loading || ariaBusy,\n 'aria-disabled': disabled || ariaDisabled,\n 'aria-readonly': readOnly || ariaReadOnly,\n }),\n [isInvalid, ariaInvalid, loading, ariaBusy, disabled, ariaDisabled, readOnly, ariaReadOnly],\n );\n\n // Read-only and loading triggers stay focusable but do not open or take typeahead,\n // as on Combobox. Radix skips its own handler when the event is default-prevented.\n const isBlocked = Boolean(readOnly || loading);\n const blockedHandlers = isBlocked\n ? {\n onPointerDown: (event: React.PointerEvent<HTMLButtonElement>) => event.preventDefault(),\n onClick: (event: React.MouseEvent<HTMLButtonElement>) => {\n event.preventDefault();\n event.currentTarget.focus();\n },\n onKeyDown: (event: React.KeyboardEvent<HTMLButtonElement>) => {\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n if (OPEN_KEYS.includes(event.key) || (!isModifierKey && event.key.length === 1)) {\n event.preventDefault();\n }\n },\n }\n : undefined;\n\n return (\n // `disabled` goes to Radix, which merges it with Root's and sets the native attribute.\n <SelectPrimitive.Trigger asChild disabled={disabled} {...blockedHandlers}>\n <button\n data-accent-color={color}\n data-radius={radius}\n data-error={error}\n data-loading={loading}\n {...triggerProps}\n {...ariaProps}\n ref={forwardedRef}\n className={classNames('kui-reset', 'kui-SelectTrigger', className)}\n >\n <span className=\"kui-SelectTriggerInner\">\n <SelectPrimitive.Value placeholder={placeholder}>{children}</SelectPrimitive.Value>\n </span>\n <SelectPrimitive.Icon asChild>\n {loading ? (\n <span className=\"kui-SelectIcon kui-SelectLoadingIcon\" aria-hidden=\"true\">\n <Spinner />\n </span>\n ) : (\n <ChevronDownIcon className=\"kui-SelectIcon\" />\n )}\n </SelectPrimitive.Icon>\n </button>\n </SelectPrimitive.Trigger>\n );\n },\n);\nSelectTrigger.displayName = 'Select.Trigger';\n\ntype SelectContentElement = React.ElementRef<typeof SelectPrimitive.Content>;\ntype SelectContentOwnProps = GetPropDefTypes<typeof selectContentPropDefs>;\ninterface SelectContentProps\n extends ComponentPropsWithout<typeof SelectPrimitive.Content, RemovedProps>,\n SelectContentOwnProps {\n container?: React.ComponentPropsWithoutRef<typeof SelectPrimitive.Portal>['container'];\n}\nconst SelectContent = React.forwardRef<SelectContentElement, SelectContentProps>(\n (props, forwardedRef) => {\n const context = React.useContext(SelectContext);\n const { className, children, color, container, ...contentProps } = extractProps(\n // Pass size value from the context to generate styles\n { size: context?.size, ...props },\n // Pass size prop def to allow it to be extracted\n selectSizePropDefs,\n selectContentPropDefs,\n );\n const themeContext = useThemeContext();\n\n // While closed, Radix still renders Content's children, into a detached fragment: the\n // items must exist for the trigger's value label, typeahead and the native form select.\n // Nothing in that fragment is ever shown, so the theme wrapper and the scroll area, with\n // its two resize observers, are left out until the list opens.\n if (context.open === false && !contentProps.forceMount) {\n return (\n <SelectPrimitive.Portal container={container}>\n <SelectPrimitive.Content {...contentProps} asChild={false} ref={forwardedRef}>\n {children}\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n }\n\n const resolvedColor = color || themeContext.accentColor;\n return (\n <SelectPrimitive.Portal container={container}>\n <PortalTheme asChild>\n <SelectPrimitive.Content\n data-accent-color={resolvedColor}\n sideOffset={4}\n {...contentProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'kui-PopperContent',\n 'kui-BaseMenuContent',\n 'kui-variant-soft',\n 'kui-SelectContent',\n className,\n )}\n >\n <SelectScrollArea>{children}</SelectScrollArea>\n </SelectPrimitive.Content>\n </PortalTheme>\n </SelectPrimitive.Portal>\n );\n },\n);\nSelectContent.displayName = 'Select.Content';\n\n/** The open list's scroll area. Its own component so the thumb sync hook runs only while open. */\nfunction SelectScrollArea({ children }: { children: React.ReactNode }) {\n const setThumbViewport = useThumbSync<HTMLDivElement>();\n return (\n <ScrollAreaPrimitive.Root type=\"auto\" className=\"kui-ScrollAreaRoot\">\n <SelectPrimitive.Viewport\n asChild\n className={classNames('kui-BaseMenuViewport', 'kui-SelectViewport')}\n >\n <ScrollAreaPrimitive.Viewport\n ref={setThumbViewport}\n className=\"kui-ScrollAreaViewport\"\n style={{ overflowY: undefined }}\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n </SelectPrimitive.Viewport>\n <ScrollAreaPrimitive.Scrollbar className=\"kui-ScrollAreaScrollbar\" orientation=\"vertical\">\n <ScrollAreaPrimitive.Thumb className=\"kui-ScrollAreaThumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n </ScrollAreaPrimitive.Root>\n );\n}\n\ntype SelectItemElement = React.ElementRef<typeof SelectPrimitive.Item>;\ninterface SelectItemProps\n extends ComponentPropsWithout<typeof SelectPrimitive.Item, RemovedProps> {}\nconst SelectItem = React.forwardRef<SelectItemElement, SelectItemProps>((props, forwardedRef) => {\n const { className, children, ...itemProps } = props;\n\n // Detect if this is rich content (not just a string)\n const isRichContent = typeof children !== 'string';\n\n // Rich content is not the same as several lines: an icon and a label is one line, and its mark\n // stays centred. Only content taller than one and a half lines pins the mark to the first line.\n // Written to the DOM, not state, so measuring never re-renders the list.\n const itemRef = React.useRef<HTMLDivElement>(null);\n const composedRef = useComposedRefs(forwardedRef, itemRef);\n useLayoutEffect(() => {\n const item = itemRef.current;\n const text = item?.querySelector(':scope > :not(.kui-SelectItemIndicator)');\n if (!item || !text || !isRichContent) return;\n const lineHeight = parseFloat(getComputedStyle(item).lineHeight);\n item.toggleAttribute('data-multiline', text.getBoundingClientRect().height > lineHeight * 1.5);\n });\n\n return (\n <SelectPrimitive.Item\n {...itemProps}\n asChild={false}\n ref={composedRef}\n className={classNames(\n 'kui-reset',\n 'kui-BaseMenuItem',\n 'kui-SelectItem',\n { 'kui-SelectItemRich': isRichContent },\n className,\n )}\n >\n <SelectPrimitive.ItemIndicator className=\"kui-SelectItemIndicator\">\n <ThickCheckIcon className=\"kui-SelectItemIndicatorIcon\" />\n </SelectPrimitive.ItemIndicator>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n );\n});\nSelectItem.displayName = 'Select.Item';\n\ntype SelectGroupElement = React.ElementRef<typeof SelectPrimitive.Group>;\ninterface SelectGroupProps\n extends ComponentPropsWithout<typeof SelectPrimitive.Group, RemovedProps> {}\nconst SelectGroup = React.forwardRef<SelectGroupElement, SelectGroupProps>(\n ({ className, ...props }, forwardedRef) => (\n <SelectPrimitive.Group\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-SelectGroup', className)}\n />\n ),\n);\nSelectGroup.displayName = 'Select.Group';\n\ntype SelectLabelElement = React.ElementRef<typeof SelectPrimitive.Label>;\ninterface SelectLabelProps\n extends ComponentPropsWithout<typeof SelectPrimitive.Label, RemovedProps> {}\nconst SelectLabel = React.forwardRef<SelectLabelElement, SelectLabelProps>(\n ({ className, ...props }, forwardedRef) => (\n <SelectPrimitive.Label\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuLabel', 'kui-SelectLabel', className)}\n />\n ),\n);\nSelectLabel.displayName = 'Select.Label';\n\ntype SelectSeparatorElement = React.ElementRef<typeof SelectPrimitive.Separator>;\ninterface SelectSeparatorProps\n extends ComponentPropsWithout<typeof SelectPrimitive.Separator, RemovedProps> {}\nconst SelectSeparator = React.forwardRef<SelectSeparatorElement, SelectSeparatorProps>(\n ({ className, ...props }, forwardedRef) => (\n <SelectPrimitive.Separator\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuSeparator', 'kui-SelectSeparator', className)}\n />\n ),\n);\nSelectSeparator.displayName = 'Select.Separator';\n\nexport {\n SelectRoot as Root,\n SelectTrigger as Trigger,\n SelectContent as Content,\n SelectItem as Item,\n SelectGroup as Group,\n SelectLabel as Label,\n SelectSeparator as Separator,\n};\n\nexport type {\n SelectRootProps as RootProps,\n SelectTriggerProps as TriggerProps,\n SelectContentProps as ContentProps,\n SelectItemProps as ItemProps,\n SelectGroupProps as GroupProps,\n SelectLabelProps as LabelProps,\n SelectSeparatorProps as SeparatorProps,\n};\n", "import type React from 'react';\n\nimport { colorPropDef } from '../props/color.prop.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4'] as const;\n\nconst selectRootPropDefs = {\n size: { type: 'enum', className: 'kui-r-size', values: sizes, default: '2', responsive: true },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n};\n\nconst triggerVariants = ['raised', 'surface', 'soft', 'outline', 'ghost'] as const;\n\nconst selectTriggerPropDefs = {\n variant: { type: 'enum', className: 'kui-variant', values: triggerVariants, default: 'raised' },\n error: { type: 'boolean' },\n loading: { type: 'boolean' },\n disabled: { type: 'boolean' },\n readOnly: { type: 'boolean' },\n ...colorPropDef,\n ...radiusPropDef,\n placeholder: { type: 'ReactNode' },\n} satisfies {\n variant: PropDef<(typeof triggerVariants)[number]>;\n error: PropDef<boolean>;\n loading: PropDef<boolean>;\n disabled: PropDef<boolean>;\n readOnly: PropDef<boolean>;\n placeholder: PropDef<React.ReactNode>;\n};\n\n\nconst selectContentPropDefs = {\n ...colorPropDef,\n} satisfies {\n};\n\nexport { selectRootPropDefs, selectTriggerPropDefs, selectContentPropDefs };\n"],
|
|
5
|
+
"mappings": ";uZAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,aAAAE,EAAA,UAAAC,EAAA,SAAAC,EAAA,UAAAC,EAAA,SAAAC,EAAA,cAAAC,EAAA,YAAAC,IAEA,UAAYC,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,UAAUC,EAAiB,cAAcC,MAA2B,WAC7E,OAAS,mBAAAC,EAAiB,mBAAAC,MAAuB,oBCEjD,IAAMC,EAAQ,CAAC,IAAK,IAAK,IAAK,GAAG,EAE3BC,EAAqB,CACzB,KAAM,CAAE,KAAM,O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B,IACxB,gBAACF,EAAgB,MAAhB,CACE,GAAGd,EACJ,QAAS,GACT,IAAKgB,EACL,UAAWsB,EAAW,oBAAqB,kBAAmBpB,CAAS,EACzE,CAEJ,EACA+C,EAAY,YAAc,eAK1B,IAAMC,EAAwB,aAC5B,CAAC,CAAE,UAAAhD,EAAW,GAAGlB,CAAM,EAAGgB,IACxB,gBAACF,EAAgB,UAAhB,CACE,GAAGd,EACJ,QAAS,GACT,IAAKgB,EACL,UAAWsB,EAAW,wBAAyB,sBAAuBpB,CAAS,EACjF,CAEJ,EACAgD,EAAgB,YAAc",
|
|
6
|
+
"names": ["select_exports", "__export", "SelectContent", "SelectGroup", "SelectItem", "SelectLabel", "SelectRoot", "SelectSeparator", "SelectTrigger", "React", "classNames", "SelectPrimitive", "ScrollAreaPrimitive", "useComposedRefs", "useLayoutEffect", "sizes", "selectRootPropDefs", "triggerVariants", "selectTriggerPropDefs", "colorPropDef", "radiusPropDef", "selectContentPropDefs", "selectSizePropDefs", "selectRootPropDefs", "OPEN_KEYS", "SelectContext", "SelectRoot", "props", "children", "sizeProp", "openProp", "defaultOpen", "onOpenChange", "rootProps", "size", "useThemeSize", "uncontrolledOpen", "setUncontrolledOpen", "open", "handleOpenChange", "next", "SelectPrimitive", "SelectTrigger", "forwardedRef", "context", "className", "color", "radius", "placeholder", "error", "loading", "disabled", "readOnly", "triggerProps", "extractProps", "selectTriggerPropDefs", "ariaInvalid", "ariaBusy", "ariaDisabled", "ariaReadOnly", "isInvalid", "ariaProps", "blockedHandlers", "event", "isModifierKey", "classNames", "Spinner", "ChevronDownIcon", "SelectContent", "container", "contentProps", "selectContentPropDefs", "themeContext", "useThemeContext", "resolvedColor", "PortalTheme", "SelectScrollArea", "setThumbViewport", "useThumbSync", "ScrollAreaPrimitive", "SelectItem", "itemProps", "isRichContent", "itemRef", "composedRef", "useComposedRefs", "useLayoutEffect", "item", "text", "lineHeight", "ThickCheckIcon", "SelectGroup", "SelectLabel", "SelectSeparator"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{a as r}from"./chunk-P7VSZYG3.js";import{a as t}from"./chunk-UMYPLUG3.js";import{b as s}from"./chunk-KRJTW535.js";import{c as e}from"./chunk-CUNKWFKA.js";var o=["1","2","3","4"],a=["raised","surface","soft","ghost","outline"],d={size:{type:"enum",className:"kui-r-size",values:o,default:"2",responsive:!0},variant:{type:"enum",className:"kui-variant",values:a,default:"raised"},error:{type:"boolean",default:!1},errorMessage:{type:"string",default:void 0},required:{type:"boolean",default:!1},"aria-describedby":{type:"string",default:void 0},"aria-labelledby":{type:"string",default:void 0},...e,...s},i=["raised","surface","soft","outline","ghost"],b={size:{type:"enum",className:"kui-r-size",values:o,default:"2",responsive:!0},variant:{type:"enum",className:"kui-variant",values:i,default:"raised"},disabled:{type:"boolean",default:!1},...e,...s},p=["left","right"],c={side:{type:"enum",values:p},...e,gap:t.gap,px:r.px,pl:r.pl,pr:r.pr};export{d as a,b,c};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
//# sourceMappingURL=chunk-EXF5SF27.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/components/text-field.props.tsx"],
|
|
4
|
-
"sourcesContent": ["import { colorPropDef } from '../props/color.prop.js';\nimport { paddingPropDefs } from '../props/padding.props.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\nimport { flexPropDefs } from './flex.props.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4'] as const;\nconst variants = ['raised', 'surface', 'soft', 'ghost', 'outline'] as const;\n\nconst textFieldRootPropDefs = {\n size: { type: 'enum', className: 'kui-r-size', values: sizes, default: '2', responsive: true },\n variant: { type: 'enum', className: 'kui-variant', values: variants, default: 'raised' },\n // Error and validation props\n error: { type: 'boolean', default: false },\n errorMessage: { type: 'string', default: undefined },\n required: { type: 'boolean', default: false },\n // Accessibility props\n 'aria-describedby': { type: 'string', default: undefined },\n 'aria-labelledby': { type: 'string', default: undefined },\n ...colorPropDef,\n ...radiusPropDef,\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n error: PropDef<boolean>;\n errorMessage: PropDef<string | undefined>;\n required: PropDef<boolean>;\n 'aria-describedby': PropDef<string | undefined>;\n 'aria-labelledby': PropDef<string | undefined>;\n};\n\n// Ghost is the dividers alone: no fill, no edge.\nconst groupVariants = ['raised', 'surface', 'soft', 'outline', 'ghost'] as const;\n\nconst textFieldGroupPropDefs = {\n size: { type: 'enum', className: 'kui-r-size', values: sizes, default: '2', responsive: true },\n variant: { type: 'enum', className: 'kui-variant', values: groupVariants, default: 'raised' },\n disabled: { type: 'boolean', default: false },\n ...colorPropDef,\n ...radiusPropDef,\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof groupVariants)[number]>;\n disabled: PropDef<boolean>;\n};\n\nconst sides = ['left', 'right'] as const;\n\nconst textFieldSlotPropDefs = {\n side: { type: 'enum', values: sides },\n ...colorPropDef,\n gap: flexPropDefs.gap,\n px: paddingPropDefs.px,\n pl: paddingPropDefs.pl,\n pr: paddingPropDefs.pr,\n} satisfies {\n side: PropDef<(typeof sides)[number]>;\n gap: typeof flexPropDefs.gap;\n px: typeof paddingPropDefs.px;\n pl: typeof paddingPropDefs.pl;\n pr: typeof paddingPropDefs.pr;\n};\n\n/** Scrubbing props for TextField.Slot - handled separately from PropDef system */\ninterface TextFieldSlotScrubProps {\n
|
|
4
|
+
"sourcesContent": ["import { colorPropDef } from '../props/color.prop.js';\nimport { paddingPropDefs } from '../props/padding.props.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\nimport { flexPropDefs } from './flex.props.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4'] as const;\nconst variants = ['raised', 'surface', 'soft', 'ghost', 'outline'] as const;\n\nconst textFieldRootPropDefs = {\n size: { type: 'enum', className: 'kui-r-size', values: sizes, default: '2', responsive: true },\n variant: { type: 'enum', className: 'kui-variant', values: variants, default: 'raised' },\n // Error and validation props\n error: { type: 'boolean', default: false },\n errorMessage: { type: 'string', default: undefined },\n required: { type: 'boolean', default: false },\n // Accessibility props\n 'aria-describedby': { type: 'string', default: undefined },\n 'aria-labelledby': { type: 'string', default: undefined },\n ...colorPropDef,\n ...radiusPropDef,\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n error: PropDef<boolean>;\n errorMessage: PropDef<string | undefined>;\n required: PropDef<boolean>;\n 'aria-describedby': PropDef<string | undefined>;\n 'aria-labelledby': PropDef<string | undefined>;\n};\n\n// Ghost is the dividers alone: no fill, no edge.\nconst groupVariants = ['raised', 'surface', 'soft', 'outline', 'ghost'] as const;\n\nconst textFieldGroupPropDefs = {\n size: { type: 'enum', className: 'kui-r-size', values: sizes, default: '2', responsive: true },\n variant: { type: 'enum', className: 'kui-variant', values: groupVariants, default: 'raised' },\n disabled: { type: 'boolean', default: false },\n ...colorPropDef,\n ...radiusPropDef,\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof groupVariants)[number]>;\n disabled: PropDef<boolean>;\n};\n\nconst sides = ['left', 'right'] as const;\n\nconst textFieldSlotPropDefs = {\n side: { type: 'enum', values: sides },\n ...colorPropDef,\n gap: flexPropDefs.gap,\n px: paddingPropDefs.px,\n pl: paddingPropDefs.pl,\n pr: paddingPropDefs.pr,\n} satisfies {\n side: PropDef<(typeof sides)[number]>;\n gap: typeof flexPropDefs.gap;\n px: typeof paddingPropDefs.px;\n pl: typeof paddingPropDefs.pl;\n pr: typeof paddingPropDefs.pr;\n};\n\n/** Scrubbing props for TextField.Slot - handled separately from PropDef system */\ninterface TextFieldSlotScrubProps {\n /**\n * Drag the slot to change the value; Up and Down on the input step it once. Ignored while the\n * field is disabled or read-only.\n */\n scrub?: boolean;\n /** Current value (required for min/max clamping to work correctly) */\n scrubValue?: number;\n /** Base value change per movement unit (default: 1) */\n scrubStep?: number;\n /** Pixels of movement per step - higher = less sensitive (default: 1) */\n scrubSensitivity?: number;\n /** Minimum allowed value */\n scrubMin?: number;\n /** Maximum allowed value */\n scrubMax?: number;\n /** Step multiplier when Shift is held (default: 10) */\n scrubShiftMultiplier?: number;\n /** Step multiplier when Alt/Option is held (default: 0.1) */\n scrubAltMultiplier?: number;\n /**\n * Callback fired during scrubbing with the value delta\n * @param delta - The change in value\n * @param isChanging - true while dragging, false when released\n */\n onScrub?: (delta: number, isChanging: boolean) => void;\n}\n\nexport type { TextFieldSlotScrubProps };\n\nexport { textFieldRootPropDefs, textFieldGroupPropDefs, textFieldSlotPropDefs };\n"],
|
|
5
5
|
"mappings": "gKAOA,IAAMA,EAAQ,CAAC,IAAK,IAAK,IAAK,GAAG,EAC3BC,EAAW,CAAC,SAAU,UAAW,OAAQ,QAAS,SAAS,EAE3DC,EAAwB,CAC5B,KAAM,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQF,EAAO,QAAS,IAAK,WAAY,EAAK,EAC7F,QAAS,CAAE,KAAM,OAAQ,UAAW,cAAe,OAAQC,EAAU,QAAS,QAAS,EAEvF,MAAO,CAAE,KAAM,UAAW,QAAS,EAAM,EACzC,aAAc,CAAE,KAAM,SAAU,QAAS,MAAU,EACnD,SAAU,CAAE,KAAM,UAAW,QAAS,EAAM,EAE5C,mBAAoB,CAAE,KAAM,SAAU,QAAS,MAAU,EACzD,kBAAmB,CAAE,KAAM,SAAU,QAAS,MAAU,EACxD,GAAGE,EACH,GAAGC,CACL,EAWMC,EAAgB,CAAC,SAAU,UAAW,OAAQ,UAAW,OAAO,EAEhEC,EAAyB,CAC7B,KAAM,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQN,EAAO,QAAS,IAAK,WAAY,EAAK,EAC7F,QAAS,CAAE,KAAM,OAAQ,UAAW,cAAe,OAAQK,EAAe,QAAS,QAAS,EAC5F,SAAU,CAAE,KAAM,UAAW,QAAS,EAAM,EAC5C,GAAGF,EACH,GAAGC,CACL,EAMMG,EAAQ,CAAC,OAAQ,OAAO,EAExBC,EAAwB,CAC5B,KAAM,CAAE,KAAM,OAAQ,OAAQD,CAAM,EACpC,GAAGJ,EACH,IAAKM,EAAa,IAClB,GAAIC,EAAgB,GACpB,GAAIA,EAAgB,GACpB,GAAIA,EAAgB,EACtB",
|
|
6
6
|
"names": ["sizes", "variants", "textFieldRootPropDefs", "colorPropDef", "radiusPropDef", "groupVariants", "textFieldGroupPropDefs", "sides", "textFieldSlotPropDefs", "flexPropDefs", "paddingPropDefs"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{a as ye}from"./chunk-YCLPURTD.js";import{a as Z}from"./chunk-OAJ5DARR.js";import{b as xe,c as $}from"./chunk-OKQAVYW4.js";import{c as ue}from"./chunk-5ON3XLRD.js";import{c as Y}from"./chunk-HBWBPBSA.js";import{b as le}from"./chunk-XU74PNM2.js";import{a as Ie}from"./chunk-VQPANPMI.js";var Ve={};Ie(Ve,{Group:()=>Fe,Root:()=>Te,Slot:()=>Me});import*as e from"react";import*as ge from"react-dom";import J from"classnames";import{composeEventHandlers as _,composeRefs as Se,useLayoutEffect as ze}from"radix-ui/internal";var Pe=["1","2","3","4"],Le=["raised","surface","soft","ghost","outline"],ce={size:{type:"enum",className:"kui-r-size",values:Pe,default:"2",responsive:!0},variant:{type:"enum",className:"kui-variant",values:Le,default:"raised"},error:{type:"boolean",default:!1},errorMessage:{type:"string",default:void 0},required:{type:"boolean",default:!1},"aria-describedby":{type:"string",default:void 0},"aria-labelledby":{type:"string",default:void 0},...Y,...le},Ne=["raised","surface","soft","outline","ghost"],de={size:{type:"enum",className:"kui-r-size",values:Pe,default:"2",responsive:!0},variant:{type:"enum",className:"kui-variant",values:Ne,default:"raised"},disabled:{type:"boolean",default:!1},...Y,...le},Ge=["left","right"],Re={side:{type:"enum",values:Ge},...Y,gap:ye.gap,px:Z.px,pl:Z.pl,pr:Z.pr};var he=e.createContext(null),pe="button, a, input, select, textarea, label, [tabindex], [contenteditable]",ve=e.createContext(null),Te=e.forwardRef((x,z)=>{let l=e.useContext(ve),d=l?{...x,size:l.size,variant:l.variant,radius:l.radius,color:x.color??l.color,disabled:!!(l.disabled||x.disabled)}:x,{className:y,style:p,...P}=ue(d,ce.size),f=e.useRef(null),{children:k,className:E,color:V,radius:U,style:H,...n}=$(P,ce),c=!!n.errorMessage,I=e.useId(),[K,O]=e.useState([]),A=e.useCallback(r=>(O(o=>o.includes(r)?o:[...o,r]),()=>O(o=>o.filter(h=>h!==r))),[]),R=e.useRef(null),j=e.useCallback(r=>(R.current=r,()=>{R.current===r&&(R.current=null)}),[]),F=!!(n.disabled||n.readOnly),B=e.useMemo(()=>({registerSlot:A,registerScrub:j,inert:F}),[A,j,F]),{"aria-describedby":L,"aria-labelledby":N,"aria-invalid":s}=n,g=!!n.error||s===!0||s==="true",W=e.useMemo(()=>{let r=[];return n.errorMessage&&r.push(I),L&&r.push(L),r.push(...K),r.length>0?r.join(" "):void 0},[n.errorMessage,L,I,K]),Q=e.useMemo(()=>({"aria-invalid":g?!0:s,"aria-describedby":W,"aria-labelledby":N}),[g,s,W,N]),{error:b,errorMessage:ee,required:q,"aria-describedby":fe,"aria-labelledby":te,onKeyDown:X,...M}=n,S=r=>{let o=R.current;!o||F||r.key!=="ArrowUp"&&r.key!=="ArrowDown"||(r.preventDefault(),o(r.key==="ArrowUp"?1:-1,r.shiftKey,r.altKey))},u=e.useCallback(r=>{let o=r.target;if(o.closest(pe))return;let h=f.current;if(!h)return;let w=o.closest(`
|
|
3
|
+
.kui-TextFieldSlot[data-side='right'],
|
|
4
|
+
.kui-TextFieldSlot:not([data-side='right']) ~ .kui-TextFieldSlot:not([data-side='left'])
|
|
5
|
+
`)?h.value.length:0;r.preventDefault(),h.focus();try{h.setSelectionRange(w,w)}catch{}},[]),D=e.createElement("div",{"data-accent-color":V,"data-radius":U,style:c?H:xe(H,p),className:J("kui-TextFieldRoot",E,!c&&y,{"kui-error":g}),onMouseDown:u},e.createElement("input",{...M,required:q||void 0,...Q,onKeyDown:_(X,S),ref:Se(f,z),className:"kui-reset kui-TextFieldInput"}),e.createElement(he.Provider,{value:B},k));return e.createElement("div",{className:J("kui-TextFieldWrapper",c&&y),style:c?p:void 0,"data-message":c||void 0},D,c?e.createElement("div",{id:I,className:"kui-TextFieldErrorMessage",role:"alert"},n.errorMessage):null)});Te.displayName="TextField.Root";var Fe=e.forwardRef((x,z)=>{let l=ue(x,de.size),{size:d,variant:y,radius:p,color:P,disabled:f}=l,{className:k,children:E,radius:V,color:U,disabled:H,...n}=$(l,de),c=e.useMemo(()=>({size:d,variant:y,radius:p,color:P,disabled:f}),[d,y,p,P,f]);return e.createElement("div",{role:"group","data-accent-color":P,"data-radius":p,"data-disabled":f||void 0,...n,ref:z,className:J("kui-TextFieldGroup",k)},e.createElement(ve.Provider,{value:c},E))});Fe.displayName="TextField.Group";var Me=e.forwardRef((x,z)=>{let{scrub:l,scrubValue:d,scrubStep:y=1,scrubSensitivity:p=1,scrubMin:P,scrubMax:f,scrubShiftMultiplier:k=10,scrubAltMultiplier:E=.1,onScrub:V,...U}=x,{className:H,color:n,side:c,onPointerDown:I,onPointerMove:K,onPointerUp:O,onLostPointerCapture:A,...R}=$(U,Re),j=e.useId(),F=R.id??j,B=e.useContext(he),L=B?.registerSlot,N=B?.registerScrub,s=!!l&&!B?.inert,g=e.useRef(null),[W,Q]=e.useState(null);ze(()=>{let t=!!g.current?.querySelector(pe);Q(i=>i===t?i:t)}),e.useEffect(()=>W===!1?L?.(F):void 0,[L,F,W]);let[b,ee]=e.useState(!1),[q,fe]=e.useState({x:0,y:0}),te=e.useRef(null),X=e.useRef(0),M=e.useRef(0),S=e.useRef(0),u=e.useRef(0),D=e.useRef(null),r=e.useRef(0),o=e.useRef({scrubValue:d,scrubStep:y,scrubSensitivity:p,scrubMin:P,scrubMax:f,scrubShiftMultiplier:k,scrubAltMultiplier:E,onScrub:V});o.current={scrubValue:d,scrubStep:y,scrubSensitivity:p,scrubMin:P,scrubMax:f,scrubShiftMultiplier:k,scrubAltMultiplier:E,onScrub:V};let h=e.useCallback(t=>{if(!s||t.target.closest(pe))return;t.preventDefault(),M.current=0,S.current=d??0,u.current=t.clientX,X.current=t.clientY,fe({x:t.clientX,y:t.clientY});let G=g.current;G&&(D.current=t.pointerId,r.current=t.clientX,G.setPointerCapture(t.pointerId),ee(!0))},[s,d]),re=e.useCallback((t,i,G,m)=>{let a=o.current,v=window.innerWidth,C=window.innerHeight;u.current+=t,u.current>v?u.current=u.current%v:u.current<0&&(u.current=v+u.current%v);let T=X.current+i;T>C?T=T%C:T<0&&(T=C+T%C),X.current=T;let oe=te.current;oe&&(oe.style.left=`${u.current}px`,oe.style.top=`${T}px`),M.current+=t;let se=M.current/a.scrubSensitivity;if(Math.abs(se)>=1){let ne=1;G?ne=a.scrubShiftMultiplier:m&&(ne=a.scrubAltMultiplier);let be=Math.trunc(se),ie=be*a.scrubStep*ne,ae=ie;if(a.scrubMin!==void 0||a.scrubMax!==void 0){let Ee=S.current+ie,me=Math.max(a.scrubMin??-1/0,Math.min(a.scrubMax??1/0,Ee));ae=me-S.current,S.current=me}else S.current+=ie;ae!==0&&a.onScrub?.(ae,!0),M.current=(se-be)*a.scrubSensitivity}},[]),w=e.useCallback(()=>{o.current.onScrub?.(0,!1),M.current=0,S.current=0,D.current=null,ee(!1)},[]),De=e.useCallback(t=>{if(!b)return;let i=t.clientX-r.current;r.current=t.clientX,re(i,t.movementY,t.shiftKey,t.altKey)},[b,re]),we=e.useCallback(t=>{if(D.current!==t.pointerId)return;let i=g.current;i&&D.current!==null&&i.releasePointerCapture(D.current),w()},[w]),Ce=e.useCallback(()=>{b&&w()},[b,w]);e.useEffect(()=>{if(!b)return;let t=document.createElement("style");return t.textContent="* { cursor: none !important; user-select: none !important; }",document.head.appendChild(t),()=>{document.head.removeChild(t)}},[b]),e.useEffect(()=>{if(!(!s||!N))return N((t,i,G)=>{let m=o.current,a=i?m.scrubShiftMultiplier:G?m.scrubAltMultiplier:1,v=m.scrubValue??0,C=Math.max(m.scrubMin??-1/0,Math.min(m.scrubMax??1/0,v+t*m.scrubStep*a));C!==v&&m.onScrub?.(C-v,!1)})},[s,N]);let ke=b?ge.createPortal(e.createElement("img",{ref:te,className:"kui-TextFieldSlotScrubCursor",src:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='black' stroke='white' stroke-width='1' d='M0 12 L5 7 L5 10 L19 10 L19 7 L24 12 L19 17 L19 14 L5 14 L5 17 Z'/%3E%3C/svg%3E",alt:"",style:{position:"fixed",left:q.x,top:q.y,transform:"translate(-50%, -50%)",pointerEvents:"none",zIndex:99999,width:24,height:24},"aria-hidden":"true"}),document.body):null;return e.createElement("div",{"data-accent-color":n,"data-side":c,"data-scrub":s||void 0,"data-scrubbing":b||void 0,...R,id:F,ref:Se(g,z),className:J("kui-TextFieldSlot",H),onPointerDown:s?_(I,h):I,onPointerMove:s?_(K,De):K,onPointerUp:s?_(O,we):O,onLostPointerCapture:s?_(A,Ce):A},R.children,ke)});Me.displayName="TextField.Slot";export{Te as a,Fe as b,Me as c,Ve as d};
|
|
6
|
+
//# sourceMappingURL=chunk-K5V53KTJ.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/text-field.tsx", "../../src/components/text-field.props.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport classNames from 'classnames';\nimport { composeEventHandlers, composeRefs, useLayoutEffect } from 'radix-ui/internal';\n\nimport { textFieldRootPropDefs, textFieldGroupPropDefs, textFieldSlotPropDefs, type TextFieldSlotScrubProps } from './text-field.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { mergeStyles } from '../helpers/merge-styles.js';\nimport { useThemeSizeProps } from '../hooks/theme-size.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { NotInputTextualAttributes } from '../helpers/input-attributes.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype TextFieldRootElement = React.ElementRef<'input'>;\ntype TextFieldRootOwnProps = GetPropDefTypes<typeof textFieldRootPropDefs> & {\n defaultValue?: string | number;\n value?: string | number;\n type?: 'date' | 'datetime-local' | 'email' | 'hidden' | 'month' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'time' | 'url' | 'week';\n};\ntype TextFieldInputProps = ComponentPropsWithout<'input', NotInputTextualAttributes | 'color' | 'defaultValue' | 'size' | 'type' | 'value'>;\ninterface TextFieldRootProps extends TextFieldInputProps, TextFieldRootOwnProps {}\n\n// Each Slot registers its id here, so the input can list slot content in aria-describedby. A scrub\n// slot also registers its arrow-key step, and reads whether the field takes input at all.\ntype ScrubKeyHandler = (direction: 1 | -1, shiftKey: boolean, altKey: boolean) => void;\ntype TextFieldContextValue = {\n registerSlot: (id: string) => () => void;\n registerScrub: (handler: ScrubKeyHandler) => () => void;\n inert: boolean;\n};\nconst TextFieldContext = React.createContext<TextFieldContextValue | null>(null);\n\n// Clicking anything a person could mean to press keeps its own press: the guard is a focusability\n// list, not a tag list. `[tabindex]` catches role-based widgets; `label` already redirects a click.\nconst FOCUSABLE_IN_SLOT = 'button, a, input, select, textarea, label, [tabindex], [contenteditable]';\n\n// A Group decides the look of its fields: their size, variant and radius come from it. A field\n// can still take its own color, and is disabled when either it or the group is.\ntype TextFieldGroupContextValue = Pick<TextFieldGroupOwnProps, 'size' | 'variant' | 'radius' | 'color' | 'disabled'>;\nconst TextFieldGroupContext = React.createContext<TextFieldGroupContextValue | null>(null);\n\nconst TextFieldRoot = React.forwardRef<TextFieldRootElement, TextFieldRootProps>((fieldProps, forwardedRef) => {\n const group = React.useContext(TextFieldGroupContext);\n const ownProps = group\n ? {\n ...fieldProps,\n size: group.size,\n variant: group.variant,\n radius: group.radius,\n color: fieldProps.color ?? group.color,\n disabled: Boolean(group.disabled || fieldProps.disabled),\n }\n : fieldProps;\n // The caller's className and style are kept apart from the size and variant classes: with an\n // error message they go on the wrapper, which is then the one box the parent lays out.\n const { className: ownClassName, style: ownStyle, ...themedProps } = useThemeSizeProps(ownProps, textFieldRootPropDefs.size);\n const inputRef = React.useRef<HTMLInputElement>(null);\n const { children, className, color, radius, style, ...inputProps } = extractProps(themedProps, textFieldRootPropDefs);\n const wrapped = Boolean(inputProps.errorMessage);\n\n // Generate unique IDs for accessibility\n const errorId = React.useId();\n\n // Slot content qualifies the value, so it describes the input (as in v2), in mount order.\n const [slotIds, setSlotIds] = React.useState<string[]>([]);\n const registerSlot = React.useCallback((id: string) => {\n setSlotIds((prev) => (prev.includes(id) ? prev : [...prev, id]));\n return () => setSlotIds((prev) => prev.filter((slotId) => slotId !== id));\n }, []);\n const scrubKeyRef = React.useRef<ScrubKeyHandler | null>(null);\n const registerScrub = React.useCallback((handler: ScrubKeyHandler) => {\n scrubKeyRef.current = handler;\n return () => {\n if (scrubKeyRef.current === handler) scrubKeyRef.current = null;\n };\n }, []);\n // A disabled or read-only field takes no input, so its slot does not scrub or step either.\n const inert = Boolean(inputProps.disabled || inputProps.readOnly);\n const contextValue = React.useMemo(() => ({ registerSlot, registerScrub, inert }), [registerSlot, registerScrub, inert]);\n\n const { 'aria-describedby': ariaDescribedby, 'aria-labelledby': ariaLabelledby, 'aria-invalid': ariaInvalid } = inputProps;\n\n // Invalid when `error` is set or the caller passes aria-invalid; the CSS keys on aria-invalid only.\n const isInvalid = Boolean(inputProps.error) || ariaInvalid === true || ariaInvalid === 'true';\n\n // Build aria-describedby string. The caller's ids stay; ours are appended.\n const describedBy = React.useMemo(() => {\n const parts = [];\n if (inputProps.errorMessage) parts.push(errorId);\n if (ariaDescribedby) parts.push(ariaDescribedby);\n parts.push(...slotIds);\n return parts.length > 0 ? parts.join(' ') : undefined;\n }, [inputProps.errorMessage, ariaDescribedby, errorId, slotIds]);\n\n // Build aria attributes\n const ariaProps = React.useMemo(\n () => ({\n 'aria-invalid': isInvalid ? true : ariaInvalid,\n 'aria-describedby': describedBy,\n 'aria-labelledby': ariaLabelledby,\n }),\n [isInvalid, ariaInvalid, describedBy, ariaLabelledby],\n );\n\n // Filter out our custom props to avoid DOM warnings\n const { error, errorMessage, required, 'aria-describedby': _ariaDescribedby, 'aria-labelledby': _ariaLabelledby, onKeyDown, ...nativeInputProps } = inputProps;\n\n // With a scrub slot, Up and Down step the value at once, by the slot's step, with the same Shift\n // and Option multipliers as a drag. The caller's handler runs first and can prevent it.\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n const step = scrubKeyRef.current;\n if (!step || inert || (event.key !== 'ArrowUp' && event.key !== 'ArrowDown')) return;\n event.preventDefault();\n step(event.key === 'ArrowUp' ? 1 : -1, event.shiftKey, event.altKey);\n };\n\n // Clicking the padding or a passive slot focuses the input. preventDefault stops the browser\n // from moving focus to the root first, so the input is focused once, synchronously.\n const handleMouseDown = React.useCallback((event: React.MouseEvent) => {\n const target = event.target as HTMLElement;\n if (target.closest(FOCUSABLE_IN_SLOT)) return;\n\n const input = inputRef.current;\n if (!input) return;\n\n // Same selector as in the CSS to find the right slot\n const isRightSlot = target.closest(`\n .kui-TextFieldSlot[data-side='right'],\n .kui-TextFieldSlot:not([data-side='right']) ~ .kui-TextFieldSlot:not([data-side='left'])\n `);\n\n const cursorPosition = isRightSlot ? input.value.length : 0;\n\n event.preventDefault();\n input.focus();\n // Only some input types support this, browsers will throw an error if not supported\n // See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange#:~:text=Note%20that%20according,not%20support%20selection%22.\n try {\n input.setSelectionRange(cursorPosition, cursorPosition);\n } catch {}\n }, []);\n\n // A pointer-only hit-target redirect to the input; keyboard users reach the input directly.\n const field = (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div\n data-accent-color={color}\n data-radius={radius}\n style={wrapped ? style : mergeStyles(style, ownStyle)}\n className={classNames('kui-TextFieldRoot', className, !wrapped && ownClassName, {\n // Not used by the library's CSS (invalid styling keys on aria-invalid); kept as a hook for app styles.\n 'kui-error': isInvalid,\n })}\n onMouseDown={handleMouseDown}\n >\n <input\n {...nativeInputProps}\n required={required || undefined}\n {...ariaProps}\n onKeyDown={composeEventHandlers(onKeyDown, handleKeyDown)}\n ref={composeRefs(inputRef, forwardedRef)}\n className=\"kui-reset kui-TextFieldInput\"\n />\n <TextFieldContext.Provider value={contextValue}>{children}</TextFieldContext.Provider>\n </div>\n );\n // The wrapper is always there, so a message coming or going never moves the field in the tree:\n // moving it would remount the input, dropping focus, the caret and an uncontrolled value. With\n // no message it is `display: contents` and the field is the box the parent lays out; with one\n // it holds the field and the message below it, and the caller's className and style size the pair.\n return (\n <div className={classNames('kui-TextFieldWrapper', wrapped && ownClassName)} style={wrapped ? ownStyle : undefined} data-message={wrapped || undefined}>\n {field}\n {wrapped ? (\n <div id={errorId} className=\"kui-TextFieldErrorMessage\" role=\"alert\">\n {inputProps.errorMessage}\n </div>\n ) : null}\n </div>\n );\n});\nTextFieldRoot.displayName = 'TextField.Root';\n\ntype TextFieldGroupOwnProps = GetPropDefTypes<typeof textFieldGroupPropDefs>;\ninterface TextFieldGroupProps extends ComponentPropsWithout<'div', RemovedProps>, TextFieldGroupOwnProps {}\n\n/**\n * Joins two or more fields into one, such as X, Y and Z: one edge, square inner corners and a\n * hairline between the fields. The group draws the edge, so each field keeps only its fill.\n */\nconst TextFieldGroup = React.forwardRef<HTMLDivElement, TextFieldGroupProps>((ownProps, forwardedRef) => {\n const props = useThemeSizeProps(ownProps, textFieldGroupPropDefs.size);\n const { size, variant, radius, color, disabled } = props;\n const { className, children, radius: _radius, color: _color, disabled: _disabled, ...domProps } = extractProps(props, textFieldGroupPropDefs);\n const contextValue = React.useMemo(() => ({ size, variant, radius, color, disabled }), [size, variant, radius, color, disabled]);\n return (\n <div\n role=\"group\"\n data-accent-color={color}\n data-radius={radius}\n data-disabled={disabled || undefined}\n {...domProps}\n ref={forwardedRef}\n className={classNames('kui-TextFieldGroup', className)}\n >\n <TextFieldGroupContext.Provider value={contextValue}>{children}</TextFieldGroupContext.Provider>\n </div>\n );\n});\nTextFieldGroup.displayName = 'TextField.Group';\n\ntype TextFieldSlotElement = React.ElementRef<'div'>;\ntype TextFieldSlotOwnProps = GetPropDefTypes<typeof textFieldSlotPropDefs> & TextFieldSlotScrubProps;\ninterface TextFieldSlotProps extends ComponentPropsWithout<'div', RemovedProps>, TextFieldSlotOwnProps {}\n\nconst TextFieldSlot = React.forwardRef<TextFieldSlotElement, TextFieldSlotProps>((props, forwardedRef) => {\n // Extract scrub props first (not part of PropDef system)\n const { scrub: scrubProp, scrubValue, scrubStep = 1, scrubSensitivity = 1, scrubMin, scrubMax, scrubShiftMultiplier = 10, scrubAltMultiplier = 0.1, onScrub, ...restProps } = props;\n\n // Then extract styling props\n const { className, color, side, onPointerDown, onPointerMove, onPointerUp, onLostPointerCapture, ...slotProps } = extractProps(\n restProps,\n textFieldSlotPropDefs,\n );\n\n // A slot of text describes the input (see TextFieldRoot); a caller's own id is kept. A slot\n // holding a control, such as a show-password button, does not: the input would be described\n // by the button's name.\n const generatedId = React.useId();\n const slotId = slotProps.id ?? generatedId;\n const fieldContext = React.useContext(TextFieldContext);\n const registerSlot = fieldContext?.registerSlot;\n const registerScrub = fieldContext?.registerScrub;\n const scrub = Boolean(scrubProp) && !fieldContext?.inert;\n const slotRef = React.useRef<HTMLDivElement>(null);\n // Unknown until the slot has rendered; it registers once it is known to hold only text.\n const [holdsControl, setHoldsControl] = React.useState<boolean | null>(null);\n useLayoutEffect(() => {\n const next = Boolean(slotRef.current?.querySelector(FOCUSABLE_IN_SLOT));\n setHoldsControl((prev) => (prev === next ? prev : next));\n });\n React.useEffect(() => (holdsControl === false ? registerSlot?.(slotId) : undefined), [registerSlot, slotId, holdsControl]);\n\n const [isScrubbing, setIsScrubbing] = React.useState(false);\n // Where the virtual cursor starts. Movement is written straight to the cursor element, so a\n // scrub does not re-render the slot on every mouse move.\n const [cursorStart, setCursorStart] = React.useState({ x: 0, y: 0 });\n const cursorRef = React.useRef<HTMLImageElement>(null);\n // Virtual cursor Y, tracked beside virtualX\n const virtualY = React.useRef(0);\n\n // Track accumulated sub-step movement for precision\n const accumulatedMovement = React.useRef(0);\n // Track current value for clamping (initialized to scrubValue when scrubbing starts)\n const currentValue = React.useRef(0);\n // Track virtual X position for wrap-around (separate from rendered position)\n const virtualX = React.useRef(0);\n // Track pointer ID for capture mode\n const pointerIdRef = React.useRef<number | null>(null);\n // Track last X position for capture mode (movementX calculation)\n const lastXRef = React.useRef(0);\n\n // Store scrub config in refs so document handlers can access latest values\n const scrubConfigRef = React.useRef({\n scrubValue,\n scrubStep,\n scrubSensitivity,\n scrubMin,\n scrubMax,\n scrubShiftMultiplier,\n scrubAltMultiplier,\n onScrub,\n });\n scrubConfigRef.current = {\n scrubValue,\n scrubStep,\n scrubSensitivity,\n scrubMin,\n scrubMax,\n scrubShiftMultiplier,\n scrubAltMultiplier,\n onScrub,\n };\n\n const handlePointerDown = React.useCallback(\n (event: React.PointerEvent) => {\n if (!scrub) return;\n\n // Don't start scrubbing if clicking on interactive elements\n const target = event.target as HTMLElement;\n if (target.closest(FOCUSABLE_IN_SLOT)) return;\n\n event.preventDefault();\n accumulatedMovement.current = 0;\n // Initialize to current value so min/max clamping works correctly\n currentValue.current = scrubValue ?? 0;\n\n // Initialize virtual cursor at actual mouse position\n virtualX.current = event.clientX;\n virtualY.current = event.clientY;\n setCursorStart({ x: event.clientX, y: event.clientY });\n\n const slot = slotRef.current;\n if (!slot) return;\n\n // Pointer capture in every browser. Pointer lock gave endless travel in Chrome, but Chrome\n // shows its \"Press Esc to show your cursor\" banner on every drag, which is noise for a\n // gesture repeated all day. Captured, the drag keeps going past the window, up to the edge\n // of the screen.\n pointerIdRef.current = event.pointerId;\n lastXRef.current = event.clientX;\n slot.setPointerCapture(event.pointerId);\n setIsScrubbing(true);\n },\n [scrub, scrubValue],\n );\n\n // Shared scrub calculation logic\n const processScrubMovement = React.useCallback((movementX: number, movementY: number, shiftKey: boolean, altKey: boolean) => {\n const config = scrubConfigRef.current;\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n\n // Update virtual position with wrap-around at viewport edges\n virtualX.current += movementX;\n if (virtualX.current > viewportWidth) {\n virtualX.current = virtualX.current % viewportWidth;\n } else if (virtualX.current < 0) {\n virtualX.current = viewportWidth + (virtualX.current % viewportWidth);\n }\n\n // Also track Y with wrap-around\n let newY = virtualY.current + movementY;\n if (newY > viewportHeight) {\n newY = newY % viewportHeight;\n } else if (newY < 0) {\n newY = viewportHeight + (newY % viewportHeight);\n }\n virtualY.current = newY;\n\n const cursor = cursorRef.current;\n if (cursor) {\n cursor.style.left = `${virtualX.current}px`;\n cursor.style.top = `${newY}px`;\n }\n\n // Accumulate movement for sensitivity calculation\n accumulatedMovement.current += movementX;\n\n // Calculate how many steps we've moved\n const stepsFromMovement = accumulatedMovement.current / config.scrubSensitivity;\n\n if (Math.abs(stepsFromMovement) >= 1) {\n // Determine modifier multiplier\n let multiplier = 1;\n if (shiftKey) {\n multiplier = config.scrubShiftMultiplier;\n } else if (altKey) {\n multiplier = config.scrubAltMultiplier;\n }\n\n // Calculate delta\n const wholeSteps = Math.trunc(stepsFromMovement);\n const delta = wholeSteps * config.scrubStep * multiplier;\n\n // Apply min/max clamping if bounds are set\n let clampedDelta = delta;\n if (config.scrubMin !== undefined || config.scrubMax !== undefined) {\n const newValue = currentValue.current + delta;\n const clampedValue = Math.max(config.scrubMin ?? -Infinity, Math.min(config.scrubMax ?? Infinity, newValue));\n clampedDelta = clampedValue - currentValue.current;\n currentValue.current = clampedValue;\n } else {\n currentValue.current += delta;\n }\n\n // Fire callback with clamped delta (isChanging = true during drag)\n if (clampedDelta !== 0) {\n config.onScrub?.(clampedDelta, true);\n }\n\n // Keep the fractional remainder for smooth sub-pixel accumulation\n accumulatedMovement.current = (stepsFromMovement - wholeSteps) * config.scrubSensitivity;\n }\n }, []);\n\n // End scrubbing helper\n const endScrubbing = React.useCallback(() => {\n scrubConfigRef.current.onScrub?.(0, false);\n accumulatedMovement.current = 0;\n currentValue.current = 0;\n pointerIdRef.current = null;\n setIsScrubbing(false);\n }, []);\n\n const handlePointerMove = React.useCallback(\n (event: React.PointerEvent) => {\n if (!isScrubbing) return;\n\n const movementX = event.clientX - lastXRef.current;\n lastXRef.current = event.clientX;\n\n processScrubMovement(movementX, event.movementY, event.shiftKey, event.altKey);\n },\n [isScrubbing, processScrubMovement],\n );\n\n const handlePointerUp = React.useCallback(\n (event: React.PointerEvent) => {\n if (pointerIdRef.current !== event.pointerId) return;\n\n const slot = slotRef.current;\n if (slot && pointerIdRef.current !== null) {\n slot.releasePointerCapture(pointerIdRef.current);\n }\n endScrubbing();\n },\n [endScrubbing],\n );\n\n const handleLostPointerCapture = React.useCallback(() => {\n if (isScrubbing) {\n endScrubbing();\n }\n }, [isScrubbing, endScrubbing]);\n\n // Hide native cursor and disable text selection during pointer capture scrubbing\n React.useEffect(() => {\n if (!isScrubbing) return;\n\n // Create a style element to hide cursor globally during scrub\n const style = document.createElement('style');\n style.textContent = '* { cursor: none !important; user-select: none !important; }';\n document.head.appendChild(style);\n\n return () => {\n document.head.removeChild(style);\n };\n }, [isScrubbing]);\n\n // Up and Down on the input step once. The step is a whole change, so it reports isChanging\n // false at once: one undo step per press, as a drag is one per release.\n React.useEffect(() => {\n if (!scrub || !registerScrub) return;\n return registerScrub((direction, shiftKey, altKey) => {\n const config = scrubConfigRef.current;\n const multiplier = shiftKey ? config.scrubShiftMultiplier : altKey ? config.scrubAltMultiplier : 1;\n const start = config.scrubValue ?? 0;\n const next = Math.max(config.scrubMin ?? -Infinity, Math.min(config.scrubMax ?? Infinity, start + direction * config.scrubStep * multiplier));\n if (next !== start) config.onScrub?.(next - start, false);\n });\n }, [scrub, registerScrub]);\n\n // Render virtual cursor via portal to body so it's not clipped\n // Using a data URI of ew-resize cursor for a native look\n const virtualCursor = isScrubbing\n ? ReactDOM.createPortal(\n <img\n ref={cursorRef}\n className=\"kui-TextFieldSlotScrubCursor\"\n src=\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='black' stroke='white' stroke-width='1' d='M0 12 L5 7 L5 10 L19 10 L19 7 L24 12 L19 17 L19 14 L5 14 L5 17 Z'/%3E%3C/svg%3E\"\n alt=\"\"\n style={{\n position: 'fixed',\n left: cursorStart.x,\n top: cursorStart.y,\n transform: 'translate(-50%, -50%)',\n pointerEvents: 'none',\n zIndex: 99999,\n width: 24,\n height: 24,\n }}\n aria-hidden=\"true\"\n />,\n document.body,\n )\n : null;\n\n return (\n <div\n data-accent-color={color}\n data-side={side}\n data-scrub={scrub || undefined}\n data-scrubbing={isScrubbing || undefined}\n {...slotProps}\n id={slotId}\n ref={composeRefs(slotRef, forwardedRef)}\n className={classNames('kui-TextFieldSlot', className)}\n // The caller's handlers run first; the scrub handlers only when `scrub` is set.\n onPointerDown={scrub ? composeEventHandlers(onPointerDown, handlePointerDown) : onPointerDown}\n onPointerMove={scrub ? composeEventHandlers(onPointerMove, handlePointerMove) : onPointerMove}\n onPointerUp={scrub ? composeEventHandlers(onPointerUp, handlePointerUp) : onPointerUp}\n onLostPointerCapture={scrub ? composeEventHandlers(onLostPointerCapture, handleLostPointerCapture) : onLostPointerCapture}\n >\n {slotProps.children}\n {virtualCursor}\n </div>\n );\n});\nTextFieldSlot.displayName = 'TextField.Slot';\n\nexport { TextFieldRoot as Root, TextFieldGroup as Group, TextFieldSlot as Slot };\nexport type { TextFieldRootProps as RootProps, TextFieldGroupProps as GroupProps, TextFieldSlotProps as SlotProps };\n", "import { colorPropDef } from '../props/color.prop.js';\nimport { paddingPropDefs } from '../props/padding.props.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\nimport { flexPropDefs } from './flex.props.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4'] as const;\nconst variants = ['raised', 'surface', 'soft', 'ghost', 'outline'] as const;\n\nconst textFieldRootPropDefs = {\n size: { type: 'enum', className: 'kui-r-size', values: sizes, default: '2', responsive: true },\n variant: { type: 'enum', className: 'kui-variant', values: variants, default: 'raised' },\n // Error and validation props\n error: { type: 'boolean', default: false },\n errorMessage: { type: 'string', default: undefined },\n required: { type: 'boolean', default: false },\n // Accessibility props\n 'aria-describedby': { type: 'string', default: undefined },\n 'aria-labelledby': { type: 'string', default: undefined },\n ...colorPropDef,\n ...radiusPropDef,\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n error: PropDef<boolean>;\n errorMessage: PropDef<string | undefined>;\n required: PropDef<boolean>;\n 'aria-describedby': PropDef<string | undefined>;\n 'aria-labelledby': PropDef<string | undefined>;\n};\n\n// Ghost is the dividers alone: no fill, no edge.\nconst groupVariants = ['raised', 'surface', 'soft', 'outline', 'ghost'] as const;\n\nconst textFieldGroupPropDefs = {\n size: { type: 'enum', className: 'kui-r-size', values: sizes, default: '2', responsive: true },\n variant: { type: 'enum', className: 'kui-variant', values: groupVariants, default: 'raised' },\n disabled: { type: 'boolean', default: false },\n ...colorPropDef,\n ...radiusPropDef,\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof groupVariants)[number]>;\n disabled: PropDef<boolean>;\n};\n\nconst sides = ['left', 'right'] as const;\n\nconst textFieldSlotPropDefs = {\n side: { type: 'enum', values: sides },\n ...colorPropDef,\n gap: flexPropDefs.gap,\n px: paddingPropDefs.px,\n pl: paddingPropDefs.pl,\n pr: paddingPropDefs.pr,\n} satisfies {\n side: PropDef<(typeof sides)[number]>;\n gap: typeof flexPropDefs.gap;\n px: typeof paddingPropDefs.px;\n pl: typeof paddingPropDefs.pl;\n pr: typeof paddingPropDefs.pr;\n};\n\n/** Scrubbing props for TextField.Slot - handled separately from PropDef system */\ninterface TextFieldSlotScrubProps {\n /**\n * Drag the slot to change the value; Up and Down on the input step it once. Ignored while the\n * field is disabled or read-only.\n */\n scrub?: boolean;\n /** Current value (required for min/max clamping to work correctly) */\n scrubValue?: number;\n /** Base value change per movement unit (default: 1) */\n scrubStep?: number;\n /** Pixels of movement per step - higher = less sensitive (default: 1) */\n scrubSensitivity?: number;\n /** Minimum allowed value */\n scrubMin?: number;\n /** Maximum allowed value */\n scrubMax?: number;\n /** Step multiplier when Shift is held (default: 10) */\n scrubShiftMultiplier?: number;\n /** Step multiplier when Alt/Option is held (default: 0.1) */\n scrubAltMultiplier?: number;\n /**\n * Callback fired during scrubbing with the value delta\n * @param delta - The change in value\n * @param isChanging - true while dragging, false when released\n */\n onScrub?: (delta: number, isChanging: boolean) => void;\n}\n\nexport type { TextFieldSlotScrubProps };\n\nexport { textFieldRootPropDefs, textFieldGroupPropDefs, textFieldSlotPropDefs };\n"],
|
|
5
|
+
"mappings": ";oSAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,WAAAE,GAAA,SAAAC,GAAA,SAAAC,KAEA,UAAYC,MAAW,QACvB,UAAYC,OAAc,YAC1B,OAAOC,MAAgB,aACvB,OAAS,wBAAAC,EAAsB,eAAAC,GAAa,mBAAAC,OAAuB,oBCEnE,IAAMC,GAAQ,CAAC,IAAK,IAAK,IAAK,GAAG,EAC3BC,GAAW,CAAC,SAAU,UAAW,OAAQ,QAAS,SAAS,EAE3DC,GAAwB,CAC5B,KAAM,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQF,GAAO,QAAS,IAAK,WAAY,EAAK,EAC7F,QAAS,CAAE,KAAM,OAAQ,UAAW,cAAe,OAAQC,GAAU,QAAS,QAAS,EAEvF,MAAO,CAAE,KAAM,UAAW,QAAS,EAAM,EACzC,aAAc,CAAE,KAAM,SAAU,QAAS,MAAU,EACnD,SAAU,CAAE,KAAM,UAAW,QAAS,EAAM,EAE5C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O,mBAAqB,EAC3FiB,EAAQjB,EAAO,YAAc,EAC7BpB,EAAO,KAAK,IAAIoB,EAAO,UAAY,KAAW,KAAK,IAAIA,EAAO,UAAY,IAAUiB,EAAQD,EAAYhB,EAAO,UAAYM,CAAU,CAAC,EACxI1B,IAASqC,GAAOjB,EAAO,UAAUpB,EAAOqC,EAAO,EAAK,CAC1D,CAAC,CACH,EAAG,CAAC1C,EAAO5D,CAAa,CAAC,EAIzB,IAAMuG,GAAgBrC,EACT,gBACP,gBAAC,OACC,IAAKI,GACL,UAAU,+BACV,IAAI,oPACJ,IAAI,GACJ,MAAO,CACL,SAAU,QACV,KAAMF,EAAY,EAClB,IAAKA,EAAY,EACjB,UAAW,wBACX,cAAe,OACf,OAAQ,MACR,MAAO,GACP,OAAQ,EACV,EACA,cAAY,OACd,EACA,SAAS,IACX,EACA,KAEJ,OACE,gBAAC,OACC,oBAAmBlF,EACnB,YAAWiE,EACX,aAAYS,GAAS,OACrB,iBAAgBM,GAAe,OAC9B,GAAGV,EACJ,GAAI1D,EACJ,IAAK+B,GAAYgC,EAAStF,CAAY,EACtC,UAAWoD,EAAW,oBAAqB1C,CAAS,EAEpD,cAAe2E,EAAQhC,EAAqBwB,EAAe0B,CAAiB,EAAI1B,EAChF,cAAeQ,EAAQhC,EAAqByB,EAAe6C,EAAiB,EAAI7C,EAChF,YAAaO,EAAQhC,EAAqB0B,EAAa6C,EAAe,EAAI7C,EAC1E,qBAAsBM,EAAQhC,EAAqB2B,EAAsB6C,EAAwB,EAAI7C,GAEpGC,EAAU,SACV+C,EACH,CAEJ,CAAC,EACD/D,GAAc,YAAc",
|
|
6
|
+
"names": ["text_field_exports", "__export", "TextFieldGroup", "TextFieldRoot", "TextFieldSlot", "React", "ReactDOM", "classNames", "composeEventHandlers", "composeRefs", "useLayoutEffect", "sizes", "variants", "textFieldRootPropDefs", "colorPropDef", "radiusPropDef", "groupVariants", "textFieldGroupPropDefs", "sides", "textFieldSlotPropDefs", "flexPropDefs", "paddingPropDefs", "TextFieldContext", "FOCUSABLE_IN_SLOT", "TextFieldGroupContext", "TextFieldRoot", "fieldProps", "forwardedRef", "group", "ownProps", "ownClassName", "ownStyle", "themedProps", "useThemeSizeProps", "textFieldRootPropDefs", "inputRef", "children", "className", "color", "radius", "style", "inputProps", "extractProps", "wrapped", "errorId", "slotIds", "setSlotIds", "registerSlot", "id", "prev", "slotId", "scrubKeyRef", "registerScrub", "handler", "inert", "contextValue", "ariaDescribedby", "ariaLabelledby", "ariaInvalid", "isInvalid", "describedBy", "parts", "ariaProps", "error", "errorMessage", "required", "_ariaDescribedby", "_ariaLabelledby", "onKeyDown", "nativeInputProps", "handleKeyDown", "event", "step", "handleMouseDown", "target", "input", "cursorPosition", "field", "mergeStyles", "classNames", "composeEventHandlers", "composeRefs", "TextFieldGroup", "props", "textFieldGroupPropDefs", "size", "variant", "disabled", "_radius", "_color", "_disabled", "domProps", "TextFieldSlot", "scrubProp", "scrubValue", "scrubStep", "scrubSensitivity", "scrubMin", "scrubMax", "scrubShiftMultiplier", "scrubAltMultiplier", "onScrub", "restProps", "side", "onPointerDown", "onPointerMove", "onPointerUp", "onLostPointerCapture", "slotProps", "textFieldSlotPropDefs", "generatedId", "fieldContext", "scrub", "slotRef", "holdsControl", "setHoldsControl", "useLayoutEffect", "next", "isScrubbing", "setIsScrubbing", "cursorStart", "setCursorStart", "cursorRef", "virtualY", "accumulatedMovement", "currentValue", "virtualX", "pointerIdRef", "lastXRef", "scrubConfigRef", "handlePointerDown", "slot", "processScrubMovement", "movementX", "movementY", "shiftKey", "altKey", "config", "viewportWidth", "viewportHeight", "newY", "cursor", "stepsFromMovement", "multiplier", "wholeSteps", "delta", "clampedDelta", "newValue", "clampedValue", "endScrubbing", "handlePointerMove", "handlePointerUp", "handleLostPointerCapture", "direction", "start", "virtualCursor"]
|
|
7
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import"../chunk-NG54K6FL.js";import{a as ma}from"../chunk-7QBNXNEN.js";import{e as $}from"../chunk-REORAMUH.js";import{a as aa}from"../chunk-K3GDM26A.js";import{d as ba}from"../chunk-
|
|
2
|
+
import"../chunk-NG54K6FL.js";import{a as ma}from"../chunk-7QBNXNEN.js";import{e as $}from"../chunk-REORAMUH.js";import{a as aa}from"../chunk-K3GDM26A.js";import{d as ba}from"../chunk-K5V53KTJ.js";import{a as ca}from"../chunk-FMVOB367.js";import{a as da,c as ea,d as fa,e as ga,f as ha,g as ia,h as ja,i as ka,j as la}from"../chunk-JTMLFTNZ.js";import{h as oa}from"../chunk-4LV37PHM.js";import{l as na}from"../chunk-2FYUM6TA.js";import{a as Y}from"../chunk-B6OFKABP.js";import{a as Z}from"../chunk-JKQN6QCP.js";import{h as _}from"../chunk-X7JHZ3HA.js";import{c as V}from"../chunk-TSS4K2U5.js";import{h as W}from"../chunk-676Y7ZUT.js";import{a as X}from"../chunk-324VC67W.js";import{g as pa}from"../chunk-HR2VHGJ5.js";import"../chunk-4G3FJUER.js";import"../chunk-ZG2XQUOH.js";import{a as R}from"../chunk-D2C2A2ZK.js";import{c as S}from"../chunk-HBO7W7SS.js";import{a as T}from"../chunk-H2J25HXP.js";import{a as U}from"../chunk-L66IUPDW.js";import{a as O}from"../chunk-C67MM24U.js";import{i as qa}from"../chunk-MMDZBPSX.js";import{e as P}from"../chunk-NWXODCTD.js";import{a as Q}from"../chunk-AXODGYRY.js";import{n as J}from"../chunk-2S7HPQVX.js";import{g as K}from"../chunk-5BX2YZV6.js";import{o as L}from"../chunk-67UEMB4K.js";import"../chunk-2ACVWLFA.js";import{a as M}from"../chunk-Q5SANVIW.js";import{a as N}from"../chunk-ENQV6SEA.js";import{a as y}from"../chunk-EPGIYTFK.js";import{m as C}from"../chunk-LABMK6Q7.js";import{b as z,c as A}from"../chunk-7V6M3MIR.js";import{c as D}from"../chunk-FYTLUDL3.js";import"../chunk-2VSRZ4IT.js";import{a as E}from"../chunk-JD4KR6VZ.js";import"../chunk-4KIZRO52.js";import{a as F}from"../chunk-J54GYD7A.js";import{a as G}from"../chunk-WD66RYF6.js";import{l as I}from"../chunk-2E57H3NH.js";import{g as H}from"../chunk-MJKVVGGV.js";import{a as B}from"../chunk-WUCBFB25.js";import{a as n}from"../chunk-B6YGNB3V.js";import{f as o}from"../chunk-DP7MPGR7.js";import{h as r}from"../chunk-WAXRIARV.js";import"../chunk-FATCGZZE.js";import"../chunk-7VJF6EXN.js";import{a as p}from"../chunk-JP36JSNP.js";import"../chunk-TGRHRMQI.js";import{a as s}from"../chunk-SUQJ7DD4.js";import{a as t}from"../chunk-HLIOHDEX.js";import{a as u}from"../chunk-XD3C3GVF.js";import{a as x}from"../chunk-KJZSXLIX.js";import"../chunk-Y2DBXOLT.js";import{a as v,b as w}from"../chunk-6YWHNLSC.js";import{a as q}from"../chunk-4MNRLB57.js";import"../chunk-BQC2P3SN.js";import"../chunk-UJ7JERJ5.js";import"../chunk-YMUERC2J.js";import"../chunk-AS2STDGA.js";import"../chunk-2ZKEQS76.js";import{a as d}from"../chunk-BUXK5VGR.js";import{a as c}from"../chunk-KVVRFWGQ.js";import"../chunk-YCLPURTD.js";import"../chunk-CR65RYGM.js";import{a as e,b as f,c as g,d as h}from"../chunk-GKDGNPBD.js";import"../chunk-7N2Q5WOM.js";import"../chunk-OAJ5DARR.js";import{b as a,c as b}from"../chunk-5KMEUZWN.js";import"../chunk-5JYSYTHA.js";import"../chunk-ISCZ57VL.js";import"../chunk-EB4AG3OL.js";import{a as i}from"../chunk-QPRUTOLI.js";import"../chunk-MJROOEPE.js";import{a as j}from"../chunk-MGWGD6KI.js";import"../chunk-KOAWATCI.js";import"../chunk-5KJIPH2N.js";import"../chunk-YOSLXJI5.js";import"../chunk-QEDKL23P.js";import"../chunk-LPLW7OWA.js";import"../chunk-L54FWKJE.js";import"../chunk-OKQAVYW4.js";import"../chunk-AQKSO3SW.js";import{a as k,b as l,c as m}from"../chunk-FVRVBB6O.js";import"../chunk-GHUAUFG7.js";import"../chunk-5ON3XLRD.js";import"../chunk-HBWBPBSA.js";import"../chunk-XU74PNM2.js";import"../chunk-CLJ6SEGP.js";import"../chunk-ANQLWGFN.js";import"../chunk-QRV32INS.js";import"../chunk-3QWGSRYC.js";import"../chunk-LTUW36HM.js";import"../chunk-QKCNGEX4.js";import"../chunk-WEBNIUEX.js";import"../chunk-XUCR7L4G.js";import"../chunk-G66WDIIV.js";import"../chunk-GHWEXMF6.js";import"../chunk-MAA6LEE2.js";import"../chunk-VQPANPMI.js";export{n as AccessibleIcon,o as Accordion,r as AlertDialog,s as Avatar,t as Blockquote,u as Box,x as Button,y as Card,C as Chatbar,E as Checkbox,D as CheckboxGroup,g as ChevronDownIcon,F as Chip,G as Code,I as Combobox,A as Confirmation,J as ContextMenu,K as Dialog,L as DropdownMenu,c as Flex,M as Grid,p as Heading,N as Image,i as Kbd,O as Link,qa as MessageScroller,P as Navbar,z as Notice,H as Popover,Q as Portal,R as Progress,T as Radio,S as RadioGroup,U as Reset,j as ScrollArea,V as SegmentedControl,W as Select,X as Separator,pa as Sheet,oa as Shell,na as Sidebar,Y as Slider,a as Slot,b as Slottable,d as Spinner,Z as Switch,_ as Table,$ as Tabs,q as Text,aa as TextArea,ba as TextField,m as Theme,k as ThemeContext,f as ThickCheckIcon,h as ThickChevronRightIcon,e as ThickDividerHorizontalIcon,ca as Toggle,la as Toolbar,fa as ToolbarButton,ia as ToolbarFill,ea as ToolbarGroup,ga as ToolbarOverflow,ja as ToolbarSeparator,ha as ToolbarSlot,ka as ToolbarTitle,w as Tooltip,v as TooltipProvider,ma as VirtualMenu,B as VisuallyHidden,l as useThemeContext,da as useToolbarOverflow};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/components/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,IAAI,eAAe,E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AAG;AAC7E,QAAA,MAAM,UAAU,wFAsCd,CAAC;AAIH,UAAU,gBACR,SAAQ,qBAAqB,CAAC,OAAO,eAAe,CAAC,KAAK,EAAE,YAAY,CAAC;CAAG;AAC9E,QAAA,MAAM,WAAW,yFAShB,CAAC;AAIF,UAAU,gBACR,SAAQ,qBAAqB,CAAC,OAAO,eAAe,CAAC,KAAK,EAAE,YAAY,CAAC;CAAG;AAC9E,QAAA,MAAM,WAAW,yFAShB,CAAC;AAIF,UAAU,oBACR,SAAQ,qBAAqB,CAAC,OAAO,eAAe,CAAC,SAAS,EAAE,YAAY,CAAC;CAAG;AAClF,QAAA,MAAM,eAAe,6FASpB,CAAC;AAGF,OAAO,EACL,UAAU,IAAI,IAAI,EAClB,aAAa,IAAI,OAAO,EACxB,aAAa,IAAI,OAAO,EACxB,UAAU,IAAI,IAAI,EAClB,WAAW,IAAI,KAAK,EACpB,WAAW,IAAI,KAAK,EACpB,eAAe,IAAI,SAAS,GAC7B,CAAC;AAEF,YAAY,EACV,eAAe,IAAI,SAAS,EAC5B,kBAAkB,IAAI,YAAY,EAClC,kBAAkB,IAAI,YAAY,EAClC,eAAe,IAAI,SAAS,EAC5B,gBAAgB,IAAI,UAAU,EAC9B,gBAAgB,IAAI,UAAU,EAC9B,oBAAoB,IAAI,cAAc,GACvC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use client";import{a,b,c,d,e,f,g}from"../chunk-
|
|
2
|
+
"use client";import{a,b,c,d,e,f,g}from"../chunk-676Y7ZUT.js";import"../chunk-BUXK5VGR.js";import"../chunk-KVVRFWGQ.js";import"../chunk-YCLPURTD.js";import"../chunk-CR65RYGM.js";import"../chunk-GKDGNPBD.js";import"../chunk-7N2Q5WOM.js";import"../chunk-OAJ5DARR.js";import"../chunk-5KMEUZWN.js";import"../chunk-KOAWATCI.js";import"../chunk-LPLW7OWA.js";import"../chunk-L54FWKJE.js";import"../chunk-OKQAVYW4.js";import"../chunk-AQKSO3SW.js";import"../chunk-FVRVBB6O.js";import"../chunk-GHUAUFG7.js";import"../chunk-5ON3XLRD.js";import"../chunk-HBWBPBSA.js";import"../chunk-XU74PNM2.js";import"../chunk-CLJ6SEGP.js";import"../chunk-ANQLWGFN.js";import"../chunk-VQPANPMI.js";export{c as Content,e as Group,d as Item,f as Label,a as Root,g as Separator,b as Trigger};
|
|
3
3
|
//# sourceMappingURL=select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../../src/components/text-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,KAAK,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAK3I,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D,KAAK,qBAAqB,GAAG,eAAe,CAAC,OAAO,qBAAqB,CAAC,GAAG;IAC3E,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,gBAAgB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;CAC/I,CAAC;AACF,KAAK,mBAAmB,GAAG,qBAAqB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,GAAG,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;AAC5I,UAAU,kBAAmB,S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M,cAAc,4FAkBlB,CAAC;AAIH,KAAK,qBAAqB,GAAG,eAAe,CAAC,OAAO,qBAAqB,CAAC,GAAG,uBAAuB,CAAC;AACrG,UAAU,kBAAmB,SAAQ,qBAAqB,CAAC,KAAK,EAAE,YAAY,CAAC,EAAE,qBAAqB;CAAG;AAEzG,QAAA,MAAM,aAAa,2FA2RjB,CAAC;AAGH,OAAO,EAAE,aAAa,IAAI,IAAI,EAAE,cAAc,IAAI,KAAK,EAAE,aAAa,IAAI,IAAI,EAAE,CAAC;AACjF,YAAY,EAAE,kBAAkB,IAAI,SAAS,EAAE,mBAAmB,IAAI,UAAU,EAAE,kBAAkB,IAAI,SAAS,EAAE,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use client";import{a,b,c}from"../chunk-
|
|
2
|
+
"use client";import{a,b,c}from"../chunk-K5V53KTJ.js";import"../chunk-YCLPURTD.js";import"../chunk-CR65RYGM.js";import"../chunk-OAJ5DARR.js";import"../chunk-OKQAVYW4.js";import"../chunk-5ON3XLRD.js";import"../chunk-HBWBPBSA.js";import"../chunk-XU74PNM2.js";import"../chunk-CLJ6SEGP.js";import"../chunk-VQPANPMI.js";export{b as Group,a as Root,c as Slot};
|
|
3
3
|
//# sourceMappingURL=text-field.js.map
|
|
@@ -113,7 +113,10 @@ declare const textFieldSlotPropDefs: {
|
|
|
113
113
|
};
|
|
114
114
|
/** Scrubbing props for TextField.Slot - handled separately from PropDef system */
|
|
115
115
|
interface TextFieldSlotScrubProps {
|
|
116
|
-
/**
|
|
116
|
+
/**
|
|
117
|
+
* Drag the slot to change the value; Up and Down on the input step it once. Ignored while the
|
|
118
|
+
* field is disabled or read-only.
|
|
119
|
+
*/
|
|
117
120
|
scrub?: boolean;
|
|
118
121
|
/** Current value (required for min/max clamping to work correctly) */
|
|
119
122
|
scrubValue?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field.props.d.ts","sourceRoot":"","sources":["../../../src/components/text-field.props.tsx"],"names":[],"mappings":"AAUA,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoB1B,CAAC;AAKF,QAAA,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAU3B,CAAC;AAIF,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAa1B,CAAC;AAEF,kFAAkF;AAClF,UAAU,uBAAuB;IAC/B
|
|
1
|
+
{"version":3,"file":"text-field.props.d.ts","sourceRoot":"","sources":["../../../src/components/text-field.props.tsx"],"names":[],"mappings":"AAUA,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoB1B,CAAC;AAKF,QAAA,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAU3B,CAAC;AAIF,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAa1B,CAAC;AAEF,kFAAkF;AAClF,UAAU,uBAAuB;IAC/B;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,6DAA6D;IAC7D,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CACxD;AAED,YAAY,EAAE,uBAAuB,EAAE,CAAC;AAExC,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c}from"../chunk-
|
|
1
|
+
import{a,b,c}from"../chunk-EXF5SF27.js";import"../chunk-P7VSZYG3.js";import"../chunk-UMYPLUG3.js";import"../chunk-FJLYSZV3.js";import"../chunk-KRJTW535.js";import"../chunk-CUNKWFKA.js";import"../chunk-NZJGC6ZW.js";export{b as textFieldGroupPropDefs,a as textFieldRootPropDefs,c as textFieldSlotPropDefs};
|
|
2
2
|
//# sourceMappingURL=text-field.props.js.map
|
package/dist/esm/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import"./chunk-AYKOOEZR.js";import{a as uo}from"./chunk-RIHTVZVJ.js";import{a as vo,b as wo,c as yo,d as zo}from"./chunk-3LIF53YY.js";import{a as so}from"./chunk-WTP2KIK3.js";import"./chunk-NG54K6FL.js";import{a as jo}from"./chunk-7QBNXNEN.js";import{e as ro}from"./chunk-REORAMUH.js";import{a as eo}from"./chunk-K3GDM26A.js";import{d as fo}from"./chunk-
|
|
2
|
+
import"./chunk-AYKOOEZR.js";import{a as uo}from"./chunk-RIHTVZVJ.js";import{a as vo,b as wo,c as yo,d as zo}from"./chunk-3LIF53YY.js";import{a as so}from"./chunk-WTP2KIK3.js";import"./chunk-NG54K6FL.js";import{a as jo}from"./chunk-7QBNXNEN.js";import{e as ro}from"./chunk-REORAMUH.js";import{a as eo}from"./chunk-K3GDM26A.js";import{d as fo}from"./chunk-K5V53KTJ.js";import{a as mo}from"./chunk-FMVOB367.js";import{a as po,c as to,d as xo,e as ao,f as bo,g as co,h as go,i as ho,j as io}from"./chunk-JTMLFTNZ.js";import{h as lo}from"./chunk-4LV37PHM.js";import{l as ko}from"./chunk-2FYUM6TA.js";import{a as _}from"./chunk-B6OFKABP.js";import{a as $}from"./chunk-JKQN6QCP.js";import{h as oo}from"./chunk-X7JHZ3HA.js";import{c as X}from"./chunk-TSS4K2U5.js";import{h as Y}from"./chunk-676Y7ZUT.js";import{a as Z}from"./chunk-324VC67W.js";import{g as no}from"./chunk-HR2VHGJ5.js";import"./chunk-4G3FJUER.js";import"./chunk-ZG2XQUOH.js";import{a as T}from"./chunk-D2C2A2ZK.js";import{c as U}from"./chunk-HBO7W7SS.js";import{a as V}from"./chunk-H2J25HXP.js";import{a as W}from"./chunk-L66IUPDW.js";import{a as Q}from"./chunk-C67MM24U.js";import{i as qo}from"./chunk-MMDZBPSX.js";import{e as R}from"./chunk-NWXODCTD.js";import{a as S}from"./chunk-AXODGYRY.js";import{n as L}from"./chunk-2S7HPQVX.js";import{g as M}from"./chunk-5BX2YZV6.js";import{o as N}from"./chunk-67UEMB4K.js";import"./chunk-2ACVWLFA.js";import{a as O}from"./chunk-Q5SANVIW.js";import{a as P}from"./chunk-ENQV6SEA.js";import{a as A}from"./chunk-EPGIYTFK.js";import{m as E}from"./chunk-LABMK6Q7.js";import{b as B,c as C}from"./chunk-7V6M3MIR.js";import{c as F}from"./chunk-FYTLUDL3.js";import"./chunk-2VSRZ4IT.js";import{a as G}from"./chunk-JD4KR6VZ.js";import"./chunk-4KIZRO52.js";import{a as H}from"./chunk-J54GYD7A.js";import{a as I}from"./chunk-WD66RYF6.js";import{l as K}from"./chunk-2E57H3NH.js";import{g as J}from"./chunk-MJKVVGGV.js";import{a as D}from"./chunk-WUCBFB25.js";import{a as h}from"./chunk-B6YGNB3V.js";import{f as i}from"./chunk-DP7MPGR7.js";import{h as n}from"./chunk-WAXRIARV.js";import"./chunk-FATCGZZE.js";import{a as l}from"./chunk-7VJF6EXN.js";import{a as j}from"./chunk-JP36JSNP.js";import"./chunk-TGRHRMQI.js";import{a as q}from"./chunk-SUQJ7DD4.js";import{a as s}from"./chunk-HLIOHDEX.js";import{a as u}from"./chunk-XD3C3GVF.js";import{a as z}from"./chunk-KJZSXLIX.js";import{a as y}from"./chunk-Y2DBXOLT.js";import{a as v,b as w}from"./chunk-6YWHNLSC.js";import{a as k}from"./chunk-4MNRLB57.js";import"./chunk-BQC2P3SN.js";import"./chunk-UJ7JERJ5.js";import"./chunk-YMUERC2J.js";import"./chunk-AS2STDGA.js";import"./chunk-2ZKEQS76.js";import{a as f}from"./chunk-BUXK5VGR.js";import{a as e}from"./chunk-KVVRFWGQ.js";import"./chunk-YCLPURTD.js";import"./chunk-CR65RYGM.js";import{a as m,b as p,c as t,d as x}from"./chunk-GKDGNPBD.js";import"./chunk-7N2Q5WOM.js";import"./chunk-OAJ5DARR.js";import{b as o,c as r}from"./chunk-5KMEUZWN.js";import"./chunk-5JYSYTHA.js";import"./chunk-ISCZ57VL.js";import"./chunk-EB4AG3OL.js";import{a}from"./chunk-QPRUTOLI.js";import"./chunk-MJROOEPE.js";import{a as b}from"./chunk-MGWGD6KI.js";import"./chunk-KOAWATCI.js";import"./chunk-5KJIPH2N.js";import"./chunk-YOSLXJI5.js";import"./chunk-QEDKL23P.js";import"./chunk-LPLW7OWA.js";import"./chunk-L54FWKJE.js";import"./chunk-OKQAVYW4.js";import"./chunk-AQKSO3SW.js";import{a as c,b as d,c as g}from"./chunk-FVRVBB6O.js";import"./chunk-GHUAUFG7.js";import"./chunk-5ON3XLRD.js";import"./chunk-HBWBPBSA.js";import"./chunk-XU74PNM2.js";import"./chunk-CLJ6SEGP.js";import"./chunk-ANQLWGFN.js";import"./chunk-QRV32INS.js";import"./chunk-3QWGSRYC.js";import"./chunk-LTUW36HM.js";import"./chunk-QKCNGEX4.js";import"./chunk-WEBNIUEX.js";import"./chunk-XUCR7L4G.js";import"./chunk-G66WDIIV.js";import"./chunk-GHWEXMF6.js";import"./chunk-MAA6LEE2.js";import"./chunk-VQPANPMI.js";export{vo as APPEARANCE_STORAGE_KEY,h as AccessibleIcon,i as Accordion,n as AlertDialog,q as Avatar,s as Blockquote,u as Box,z as Button,A as Card,E as Chatbar,G as Checkbox,F as CheckboxGroup,t as ChevronDownIcon,H as Chip,I as Code,K as Combobox,C as Confirmation,L as ContextMenu,M as Dialog,N as DropdownMenu,e as Flex,O as Grid,j as Heading,P as Image,a as Kbd,Q as Link,qo as MessageScroller,R as Navbar,B as Notice,J as Popover,S as Portal,T as Progress,V as Radio,U as RadioGroup,W as Reset,b as ScrollArea,X as SegmentedControl,Y as Select,Z as Separator,no as Sheet,lo as Shell,ko as Sidebar,_ as Slider,o as Slot,r as Slottable,f as Spinner,$ as Switch,oo as Table,ro as Tabs,k as Text,eo as TextArea,fo as TextField,g as Theme,c as ThemeContext,p as ThickCheckIcon,x as ThickChevronRightIcon,m as ThickDividerHorizontalIcon,mo as Toggle,io as Toolbar,xo as ToolbarButton,co as ToolbarFill,to as ToolbarGroup,ao as ToolbarOverflow,go as ToolbarSeparator,bo as ToolbarSlot,ho as ToolbarTitle,w as Tooltip,v as TooltipProvider,jo as VirtualMenu,D as VisuallyHidden,wo as appearanceScript,yo as setAppearance,zo as useAppearance,l as useBodyPointerEventsCleanup,so as useLiveAnnouncer,d as useThemeContext,uo as useToggleState,po as useToolbarOverflow,y as useTooltipWrapper};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/props/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as no}from"../chunk-677CX2QF.js";import{a as lo}from"../chunk-JQVW4WNN.js";import{a as ko}from"../chunk-YLDV2HKZ.js";import{a as io,b as jo}from"../chunk-WRWNN2NW.js";import{a as to}from"../chunk-LUNWI377.js";import{a as xo,b as ao,c as bo}from"../chunk-
|
|
1
|
+
import{a as no}from"../chunk-677CX2QF.js";import{a as lo}from"../chunk-JQVW4WNN.js";import{a as ko}from"../chunk-YLDV2HKZ.js";import{a as io,b as jo}from"../chunk-WRWNN2NW.js";import{a as to}from"../chunk-LUNWI377.js";import{a as xo,b as ao,c as bo}from"../chunk-EXF5SF27.js";import{a as co}from"../chunk-YHQTFDGN.js";import{a as go}from"../chunk-FH6RT6XH.js";import{a as ho}from"../chunk-H3IAGAEL.js";import{a as U}from"../chunk-A252TSYI.js";import{a as V,b as W,c as X}from"../chunk-HCBR74BW.js";import{a as Y}from"../chunk-NR5FQCMU.js";import{a as Z}from"../chunk-3W34KH33.js";import{a as _}from"../chunk-HIEGLLY7.js";import{a as $}from"../chunk-5XA2N2WR.js";import{a as ro,b as eo,c as fo}from"../chunk-XDVTHL3S.js";import{a as oo}from"../chunk-P7VSZYG3.js";import{a as mo,b as po}from"../chunk-TZTUPQYK.js";import{a as O}from"../chunk-RAVZ7F5L.js";import{a as P}from"../chunk-EFXHBH3A.js";import{a as Q}from"../chunk-VW46DG7H.js";import{a as R}from"../chunk-SKOYHBIE.js";import{a as S}from"../chunk-KVOWI6SN.js";import"../chunk-STPMPY3X.js";import{a as T}from"../chunk-UONSKZQT.js";import"../chunk-OA7C34MJ.js";import"../chunk-WOR3JCLX.js";import{a as J}from"../chunk-UMYPLUG3.js";import{a as K}from"../chunk-DFLWZOQO.js";import{a as I}from"../chunk-FJLYSZV3.js";import{a as N}from"../chunk-HSWMHW37.js";import{a as M}from"../chunk-WTCZAUFY.js";import"../chunk-VCV7RACK.js";import{a as L}from"../chunk-KEWNXANF.js";import{a as C}from"../chunk-CT543Q2V.js";import{a as D}from"../chunk-BIITGC3Z.js";import"../chunk-6DWDNKLS.js";import{a as E}from"../chunk-OSSNMF5U.js";import{a as F}from"../chunk-4E5XBM5Q.js";import"../chunk-UICSVJ3B.js";import{a as G}from"../chunk-UUXZ4W6H.js";import{a as H}from"../chunk-PEMFIU3B.js";import{a as w,b as y}from"../chunk-VS2ZWRGO.js";import{a as z}from"../chunk-SBRPXQWH.js";import{a as A}from"../chunk-SJXV4BWZ.js";import{a as B}from"../chunk-N6KH2EOU.js";import{a}from"../chunk-OEPVYHSS.js";import{a as b}from"../chunk-AKXBXLCP.js";import{a as c,b as d,c as g,d as h,e as i,f as j}from"../chunk-AJWCSQIE.js";import{a as k}from"../chunk-BF4WRYUX.js";import{a as l}from"../chunk-ETQNRMHU.js";import{a as u}from"../chunk-DFGY2NZB.js";import{a as s}from"../chunk-FNAE6HUI.js";import{a as q}from"../chunk-NUVUXNHF.js";import{a as n}from"../chunk-EKTVL6SS.js";import{a as v}from"../chunk-NNE3KNH4.js";import{a as t,b as x}from"../chunk-KRJTW535.js";import{a as r,b as e,c as f,d as m,e as p}from"../chunk-CUNKWFKA.js";import{a as o}from"../chunk-NZJGC6ZW.js";export{m as accentColorPropDef,r as accentColors,u as alertDialogContentPropDefs,o as asChildPropDef,v as avatarPropDefs,C as blockquotePropDefs,D as boxPropDefs,jo as breakpointSet,io as breakpoints,a as buttonPropDefs,E as cardPropDefs,F as checkboxGroupRootPropDefs,b as checkboxPropDefs,G as chipPropDefs,H as codePropDefs,f as colorPropDef,i as contextMenuCheckboxItemPropDefs,g as contextMenuContentPropDefs,h as contextMenuItemPropDefs,j as contextMenuRadioItemPropDefs,g as contextMenuSubContentPropDefs,s as dialogContentPropDefs,i as dropdownMenuCheckboxItemPropDefs,d as dropdownMenuContentPropDefs,h as dropdownMenuItemPropDefs,j as dropdownMenuRadioItemPropDefs,g as dropdownMenuSubContentPropDefs,w as emphases,y as emphasisPropDef,J as flexPropDefs,I as gapPropDefs,p as grayAccentColorPropDef,e as grayColors,K as gridPropDefs,N as headingPropDefs,q as heightPropDefs,O as kbdPropDefs,lo as layoutPropDefs,L as leadingTrimPropDef,P as linkPropDefs,ko as marginPropDefs,oo as paddingPropDefs,Q as popoverContentPropDefs,R as progressPropDefs,t as radii,S as radioGroupRootPropDefs,k as radioPropDefs,x as radiusPropDef,T as scrollAreaPropDefs,U as segmentedControlRootPropDefs,X as selectContentPropDefs,V as selectRootPropDefs,W as selectTriggerPropDefs,Y as separatorPropDefs,no as shadowPropDefs,Z as sliderPropDefs,_ as spinnerPropDefs,c as submenuBehaviors,$ as switchPropDefs,fo as tableCellPropDefs,ro as tableRootPropDefs,eo as tableRowPropDefs,po as tabsContentPropDefs,l as tabsListPropDefs,mo as tabsRootPropDefs,M as textAlignPropDef,to as textAreaPropDefs,ao as textFieldGroupPropDefs,xo as textFieldRootPropDefs,bo as textFieldSlotPropDefs,co as textPropDefs,z as textWrapPropDef,go as themePropDefs,ho as tooltipPropDefs,A as truncatePropDef,B as weightPropDef,n as widthPropDefs};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -326,7 +326,7 @@
|
|
|
326
326
|
.kui-SegmentedControlRoot:where(.kui-variant-raised) {
|
|
327
327
|
--segmented-control-indicator-inset: 2px;
|
|
328
328
|
background-color: var(--field-fill);
|
|
329
|
-
box-shadow: var(--
|
|
329
|
+
box-shadow: var(--field-chrome);
|
|
330
330
|
|
|
331
331
|
&:where([data-disabled]) {
|
|
332
332
|
background-color: var(--field-fill-disabled);
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
/*
|
|
74
|
-
.kui-SelectItem:where(.kui-SelectItemRich) {
|
|
73
|
+
/* Content of more than one line grows the row; the mark stays on the first line. */
|
|
74
|
+
.kui-SelectItem:where(.kui-SelectItemRich[data-multiline]) {
|
|
75
75
|
align-items: flex-start;
|
|
76
76
|
|
|
77
77
|
& :where(.kui-SelectItemIndicator) {
|
|
@@ -194,13 +194,13 @@
|
|
|
194
194
|
* *
|
|
195
195
|
***************************************************************************************************/
|
|
196
196
|
|
|
197
|
-
/* raised: the default. A field: the surface colour with --
|
|
197
|
+
/* raised: the default. A field: the surface colour with --field-chrome. */
|
|
198
198
|
|
|
199
199
|
.kui-SelectTrigger:where(.kui-variant-raised) {
|
|
200
200
|
position: relative;
|
|
201
201
|
color: var(--accent-ink);
|
|
202
202
|
background-color: var(--field-fill);
|
|
203
|
-
box-shadow: var(--
|
|
203
|
+
box-shadow: var(--field-chrome);
|
|
204
204
|
|
|
205
205
|
&:where(:focus-visible) {
|
|
206
206
|
outline: 2px solid var(--focus-8);
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { Select as SelectPrimitive, ScrollArea as ScrollAreaPrimitive } from 'radix-ui';
|
|
6
|
+
import { useComposedRefs, useLayoutEffect } from 'radix-ui/internal';
|
|
6
7
|
|
|
7
8
|
import { extractProps } from '../helpers/extract-props.js';
|
|
8
9
|
import { useThemeSize } from '../hooks/theme-size.js';
|
|
@@ -261,11 +262,24 @@ const SelectItem = React.forwardRef<SelectItemElement, SelectItemProps>((props,
|
|
|
261
262
|
// Detect if this is rich content (not just a string)
|
|
262
263
|
const isRichContent = typeof children !== 'string';
|
|
263
264
|
|
|
265
|
+
// Rich content is not the same as several lines: an icon and a label is one line, and its mark
|
|
266
|
+
// stays centred. Only content taller than one and a half lines pins the mark to the first line.
|
|
267
|
+
// Written to the DOM, not state, so measuring never re-renders the list.
|
|
268
|
+
const itemRef = React.useRef<HTMLDivElement>(null);
|
|
269
|
+
const composedRef = useComposedRefs(forwardedRef, itemRef);
|
|
270
|
+
useLayoutEffect(() => {
|
|
271
|
+
const item = itemRef.current;
|
|
272
|
+
const text = item?.querySelector(':scope > :not(.kui-SelectItemIndicator)');
|
|
273
|
+
if (!item || !text || !isRichContent) return;
|
|
274
|
+
const lineHeight = parseFloat(getComputedStyle(item).lineHeight);
|
|
275
|
+
item.toggleAttribute('data-multiline', text.getBoundingClientRect().height > lineHeight * 1.5);
|
|
276
|
+
});
|
|
277
|
+
|
|
264
278
|
return (
|
|
265
279
|
<SelectPrimitive.Item
|
|
266
280
|
{...itemProps}
|
|
267
281
|
asChild={false}
|
|
268
|
-
ref={
|
|
282
|
+
ref={composedRef}
|
|
269
283
|
className={classNames(
|
|
270
284
|
'kui-reset',
|
|
271
285
|
'kui-BaseMenuItem',
|
|
@@ -354,14 +354,14 @@
|
|
|
354
354
|
* *
|
|
355
355
|
***************************************************************************************************/
|
|
356
356
|
|
|
357
|
-
/* Raised variant: the default. The surface colour with --
|
|
357
|
+
/* Raised variant: the default. The surface colour with --field-chrome. */
|
|
358
358
|
.kui-TextAreaRoot:where(.kui-variant-raised) {
|
|
359
359
|
--text-area-border-width: 1px;
|
|
360
360
|
--v-selection-color: var(--focus-a5);
|
|
361
361
|
--v-focus-color: var(--focus-8);
|
|
362
362
|
|
|
363
363
|
background-color: var(--field-fill);
|
|
364
|
-
box-shadow: var(--
|
|
364
|
+
box-shadow: var(--field-chrome);
|
|
365
365
|
|
|
366
366
|
& :where(.kui-TextAreaInput) {
|
|
367
367
|
&::placeholder {
|
|
@@ -392,7 +392,7 @@
|
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
394
|
|
|
395
|
-
/* raised: the default. The surface colour with --
|
|
395
|
+
/* raised: the default. The surface colour with --field-chrome. */
|
|
396
396
|
|
|
397
397
|
.kui-TextFieldRoot:where(.kui-variant-raised) {
|
|
398
398
|
--text-field-selection-color: var(--focus-a5);
|
|
@@ -400,7 +400,7 @@
|
|
|
400
400
|
--text-field-border-width: 1px;
|
|
401
401
|
|
|
402
402
|
background-color: var(--field-fill);
|
|
403
|
-
box-shadow: var(--
|
|
403
|
+
box-shadow: var(--field-chrome);
|
|
404
404
|
|
|
405
405
|
/* Hover effects */
|
|
406
406
|
@media (hover: hover) {
|
|
@@ -697,11 +697,18 @@
|
|
|
697
697
|
* *
|
|
698
698
|
***************************************************************************************************/
|
|
699
699
|
|
|
700
|
-
/*
|
|
700
|
+
/* The whole slot, padding included, is the grab area. A tint on hover shows it can be dragged. */
|
|
701
701
|
.kui-TextFieldSlot:where([data-scrub]) {
|
|
702
702
|
cursor: ew-resize !important;
|
|
703
703
|
user-select: none;
|
|
704
704
|
position: relative;
|
|
705
|
+
border-radius: calc(var(--text-field-border-radius, var(--radius-2)) - 2px);
|
|
706
|
+
|
|
707
|
+
@media (hover: hover) {
|
|
708
|
+
&:where(:hover:not([data-scrubbing])) {
|
|
709
|
+
background-color: var(--neutral-a3);
|
|
710
|
+
}
|
|
711
|
+
}
|
|
705
712
|
}
|
|
706
713
|
|
|
707
714
|
/* Ensure children also show ew-resize cursor */
|
|
@@ -792,7 +799,7 @@
|
|
|
792
799
|
|
|
793
800
|
/* Each variant's edge and divider are the ones its single field draws. */
|
|
794
801
|
.kui-TextFieldGroup:where(.kui-variant-raised) {
|
|
795
|
-
--text-field-group-edge: var(--
|
|
802
|
+
--text-field-group-edge: var(--field-chrome);
|
|
796
803
|
--text-field-group-divider: var(--neutral-a4);
|
|
797
804
|
|
|
798
805
|
&:where([data-disabled]) {
|
|
@@ -64,7 +64,10 @@ const textFieldSlotPropDefs = {
|
|
|
64
64
|
|
|
65
65
|
/** Scrubbing props for TextField.Slot - handled separately from PropDef system */
|
|
66
66
|
interface TextFieldSlotScrubProps {
|
|
67
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* Drag the slot to change the value; Up and Down on the input step it once. Ignored while the
|
|
69
|
+
* field is disabled or read-only.
|
|
70
|
+
*/
|
|
68
71
|
scrub?: boolean;
|
|
69
72
|
/** Current value (required for min/max clamping to work correctly) */
|
|
70
73
|
scrubValue?: number;
|