@fanvue/ui 3.12.1 → 3.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/Accordion/AccordionTrigger.cjs +11 -2
- package/dist/cjs/components/Accordion/AccordionTrigger.cjs.map +1 -1
- package/dist/cjs/components/AudioPlayer/AudioPlayer.cjs +357 -0
- package/dist/cjs/components/AudioPlayer/AudioPlayer.cjs.map +1 -0
- package/dist/cjs/components/Avatar/Avatar.cjs +2 -2
- package/dist/cjs/components/Avatar/Avatar.cjs.map +1 -1
- package/dist/cjs/components/Dialog/Dialog.cjs +2 -1
- package/dist/cjs/components/Dialog/Dialog.cjs.map +1 -1
- package/dist/cjs/components/DropdownMenu/DropdownMenu.cjs +25 -2
- package/dist/cjs/components/DropdownMenu/DropdownMenu.cjs.map +1 -1
- package/dist/cjs/components/FloatingActionButton/FloatingActionButton.cjs +59 -0
- package/dist/cjs/components/FloatingActionButton/FloatingActionButton.cjs.map +1 -0
- package/dist/cjs/components/Icons/GifIcon.cjs +12 -36
- package/dist/cjs/components/Icons/GifIcon.cjs.map +1 -1
- package/dist/cjs/components/Icons/GridViewIcon.cjs +50 -0
- package/dist/cjs/components/Icons/GridViewIcon.cjs.map +1 -0
- package/dist/cjs/components/Icons/ListViewIcon.cjs +50 -0
- package/dist/cjs/components/Icons/ListViewIcon.cjs.map +1 -0
- package/dist/cjs/components/ProgressBar/ProgressBar.cjs +30 -5
- package/dist/cjs/components/ProgressBar/ProgressBar.cjs.map +1 -1
- package/dist/cjs/components/ProgressBar/ProgressBarItem.cjs +49 -0
- package/dist/cjs/components/ProgressBar/ProgressBarItem.cjs.map +1 -0
- package/dist/cjs/components/ProgressBar/ProgressBarSteps.cjs +66 -0
- package/dist/cjs/components/ProgressBar/ProgressBarSteps.cjs.map +1 -0
- package/dist/cjs/components/SegmentedControl/SegmentedControl.cjs +42 -11
- package/dist/cjs/components/SegmentedControl/SegmentedControl.cjs.map +1 -1
- package/dist/cjs/components/TextArea/TextArea.cjs +4 -4
- package/dist/cjs/components/TextArea/TextArea.cjs.map +1 -1
- package/dist/cjs/components/TextField/TextField.cjs +105 -62
- package/dist/cjs/components/TextField/TextField.cjs.map +1 -1
- package/dist/cjs/index.cjs +12 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/Accordion/AccordionTrigger.mjs +11 -2
- package/dist/components/Accordion/AccordionTrigger.mjs.map +1 -1
- package/dist/components/AudioPlayer/AudioPlayer.mjs +340 -0
- package/dist/components/AudioPlayer/AudioPlayer.mjs.map +1 -0
- package/dist/components/Avatar/Avatar.mjs +2 -2
- package/dist/components/Avatar/Avatar.mjs.map +1 -1
- package/dist/components/Dialog/Dialog.mjs +2 -1
- package/dist/components/Dialog/Dialog.mjs.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.mjs +25 -2
- package/dist/components/DropdownMenu/DropdownMenu.mjs.map +1 -1
- package/dist/components/FloatingActionButton/FloatingActionButton.mjs +42 -0
- package/dist/components/FloatingActionButton/FloatingActionButton.mjs.map +1 -0
- package/dist/components/Icons/GifIcon.mjs +12 -36
- package/dist/components/Icons/GifIcon.mjs.map +1 -1
- package/dist/components/Icons/GridViewIcon.mjs +33 -0
- package/dist/components/Icons/GridViewIcon.mjs.map +1 -0
- package/dist/components/Icons/ListViewIcon.mjs +33 -0
- package/dist/components/Icons/ListViewIcon.mjs.map +1 -0
- package/dist/components/ProgressBar/ProgressBar.mjs +30 -5
- package/dist/components/ProgressBar/ProgressBar.mjs.map +1 -1
- package/dist/components/ProgressBar/ProgressBarItem.mjs +32 -0
- package/dist/components/ProgressBar/ProgressBarItem.mjs.map +1 -0
- package/dist/components/ProgressBar/ProgressBarSteps.mjs +49 -0
- package/dist/components/ProgressBar/ProgressBarSteps.mjs.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.mjs +42 -11
- package/dist/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
- package/dist/components/TextArea/TextArea.mjs +4 -4
- package/dist/components/TextArea/TextArea.mjs.map +1 -1
- package/dist/components/TextField/TextField.mjs +105 -62
- package/dist/components/TextField/TextField.mjs.map +1 -1
- package/dist/index.d.ts +237 -10
- package/dist/index.mjs +12 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.mjs","sources":["../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { CheckOutlineIcon } from \"@/index\";\nimport { cn } from \"../../utils/cn\";\n\n/** Text field height in pixels. */\nexport type TextFieldSize = \"48\" | \"40\" | \"32\";\n\nexport interface TextFieldProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\" | \"prefix\"> {\n /** Label text displayed above the input. Also used as the accessible name. */\n label?: string;\n /** Helper text displayed below the input. Replaced by `errorMessage` when `error` is `true`. */\n helperText?: string;\n /** Height of the text field in pixels. @default \"48\" */\n size?: TextFieldSize;\n /** Whether the text field is in an error state. @default false */\n error?: boolean;\n /** Error message displayed below the input. Shown instead of `helperText` when `error` is `true`. */\n errorMessage?: string;\n /** Whether the text field is validated. @default false */\n validated?: boolean;\n /** Icon element displayed at the left side of the input. */\n leftIcon?: React.ReactNode;\n /** Icon element displayed at the right side of the input. */\n rightIcon?: React.ReactNode;\n /** Whether the text field stretches to fill its container width. @default false */\n fullWidth?: boolean;\n}\n\nconst CONTAINER_HEIGHT: Record<TextFieldSize, string> = {\n \"48\": \"h-12\",\n \"40\": \"h-10\",\n \"32\": \"h-8\",\n};\n\nconst INPUT_SIZE_CLASSES: Record<TextFieldSize, string> = {\n \"48\": \"py-3 typography-body-default-16px-regular autofill-body-lg\",\n \"40\": \"py-2 typography-body-default-16px-regular autofill-body-lg\",\n \"32\": \"py-2 typography-body-small-14px-regular autofill-body-md\",\n};\n\nconst INPUT_PL: Record<TextFieldSize, { default: string; withIcon: string }> = {\n \"48\": { default: \"pl-4\", withIcon: \"pl-10\" },\n \"40\": { default: \"pl-4\", withIcon: \"pl-10\" },\n \"32\": { default: \"pl-3\", withIcon: \"pl-9\" },\n};\n\nconst INPUT_PR: Record<TextFieldSize, { default: string; withIcon: string }> = {\n \"48\": { default: \"pr-4\", withIcon: \"pr-10\" },\n \"40\": { default: \"pr-4\", withIcon: \"pr-10\" },\n \"32\": { default: \"pr-3\", withIcon: \"pr-9\" },\n};\n\nconst ICON_INSET: Record<TextFieldSize, string> = {\n \"48\": \"px-4\",\n \"40\": \"px-4\",\n \"32\": \"px-3\",\n};\n\nfunction getContainerClassName(size: TextFieldSize, error: boolean, disabled?: boolean) {\n return cn(\n \"relative overflow-hidden rounded-sm border bg-inputs-inputs-primary has-focus-visible:shadow-focus-ring has-focus-visible:outline-none motion-safe:transition-colors\",\n error ? \"border-error-content\" : \"border-border-primary\",\n !disabled && !error && \"hover:border-neutral-alphas-400\",\n CONTAINER_HEIGHT[size],\n disabled && \"opacity-50\",\n );\n}\n\nfunction getInputClassName(size: TextFieldSize, hasLeftIcon: boolean, hasRightIcon: boolean) {\n return cn(\n \"h-full w-full rounded-sm bg-transparent text-content-primary no-underline placeholder:text-content-tertiary focus:outline-none disabled:cursor-not-allowed\",\n INPUT_SIZE_CLASSES[size],\n hasLeftIcon ? INPUT_PL[size].withIcon : INPUT_PL[size].default,\n hasRightIcon ? INPUT_PR[size].withIcon : INPUT_PR[size].default,\n );\n}\n\nfunction TextFieldHelperText({\n id,\n error,\n children,\n}: {\n id: string;\n error: boolean;\n children: React.ReactNode;\n}) {\n return (\n <p\n id={id}\n className={cn(\n \"typography-description-12px-regular px-2 pt-2 pb-0.5\",\n error ? \"text-error-content\" : \"text-content-secondary\",\n )}\n >\n {children}\n </p>\n );\n}\n\nfunction warnMissingAccessibleName(label?: string, ariaLabel?: string, ariaLabelledBy?: string) {\n if (process.env.NODE_ENV !== \"production\") {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n \"TextField: no accessible name provided. Pass a `label`, `aria-label`, or `aria-labelledby` prop.\",\n );\n }\n }\n}\n\n/**\n * A text input field with optional label, helper/error text, and icon slots.\n *\n * Provide at least one of `label`, `aria-label`, or `aria-labelledby` for\n * accessibility — a console warning is emitted in development if none are set.\n *\n * @example\n * ```tsx\n * <TextField\n * label=\"Email\"\n * placeholder=\"you@example.com\"\n * error={!!emailError}\n * errorMessage={emailError}\n * />\n * ```\n */\nexport const TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n label,\n helperText,\n size = \"48\",\n error = false,\n errorMessage,\n validated = false,\n leftIcon,\n rightIcon,\n className,\n id,\n disabled,\n fullWidth = false,\n ...props\n },\n ref,\n ) => {\n const generatedId = React.useId();\n const inputId = id || generatedId;\n const helperTextId = `${inputId}-helper`;\n const bottomText = error && errorMessage ? errorMessage : helperText;\n\n warnMissingAccessibleName(label, props[\"aria-label\"], props[\"aria-labelledby\"]);\n\n return (\n <div\n className={cn(\"flex flex-col\", fullWidth && \"w-full\", className)}\n data-disabled={disabled ? \"\" : undefined}\n data-error={error ? \"\" : undefined}\n >\n {label && (\n <label\n htmlFor={inputId}\n className=\"typography-description-12px-semibold pb-2 text-content-primary\"\n >\n {label}\n </label>\n )}\n\n <div className={getContainerClassName(size, error, disabled)}>\n <input\n ref={ref}\n id={inputId}\n disabled={disabled}\n aria-describedby={bottomText ? helperTextId : undefined}\n aria-invalid={error || undefined}\n className={cn(\n getInputClassName(size, !!leftIcon, !!(rightIcon || validated)),\n \"[&[type='search']::-webkit-search-cancel-button]:hidden [&[type='search']::-webkit-search-cancel-button]:appearance-none\",\n )}\n {...props}\n />\n\n {leftIcon && (\n <div\n className={cn(\n \"pointer-events-none absolute inset-y-0 left-0 flex items-center text-content-secondary\",\n ICON_INSET[size],\n )}\n >\n <div className=\"flex size-4 shrink-0 items-center justify-center\">{leftIcon}</div>\n </div>\n )}\n\n {(rightIcon || validated) && (\n <div\n className={cn(\n \"absolute inset-y-0 right-0 flex items-center gap-2 text-content-secondary\",\n ICON_INSET[size],\n )}\n >\n {rightIcon && (\n <div className=\"flex size-4 shrink-0 items-center justify-center\">{rightIcon}</div>\n )}\n {validated && (\n <div className=\"pointer-events-none flex size-4 shrink-0 items-center justify-center\">\n <CheckOutlineIcon className=\"text-success-content\" />\n </div>\n )}\n </div>\n )}\n </div>\n\n {bottomText && (\n <TextFieldHelperText id={helperTextId} error={error}>\n {bottomText}\n </TextFieldHelperText>\n )}\n </div>\n );\n },\n);\n\nTextField.displayName = \"TextField\";\n"],"names":[],"mappings":";;;;;;AA6BA,MAAM,mBAAkD;AAAA,EACtD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,qBAAoD;AAAA,EACxD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,WAAyE;AAAA,EAC7E,MAAM,EAAE,SAAS,QAAQ,UAAU,QAAA;AAAA,EACnC,MAAM,EAAE,SAAS,QAAQ,UAAU,QAAA;AAAA,EACnC,MAAM,EAAE,SAAS,QAAQ,UAAU,OAAA;AACrC;AAEA,MAAM,WAAyE;AAAA,EAC7E,MAAM,EAAE,SAAS,QAAQ,UAAU,QAAA;AAAA,EACnC,MAAM,EAAE,SAAS,QAAQ,UAAU,QAAA;AAAA,EACnC,MAAM,EAAE,SAAS,QAAQ,UAAU,OAAA;AACrC;AAEA,MAAM,aAA4C;AAAA,EAChD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,SAAS,sBAAsB,MAAqB,OAAgB,UAAoB;AACtF,SAAO;AAAA,IACL;AAAA,IACA,QAAQ,yBAAyB;AAAA,IACjC,CAAC,YAAY,CAAC,SAAS;AAAA,IACvB,iBAAiB,IAAI;AAAA,IACrB,YAAY;AAAA,EAAA;AAEhB;AAEA,SAAS,kBAAkB,MAAqB,aAAsB,cAAuB;AAC3F,SAAO;AAAA,IACL;AAAA,IACA,mBAAmB,IAAI;AAAA,IACvB,cAAc,SAAS,IAAI,EAAE,WAAW,SAAS,IAAI,EAAE;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AAW,sBAAsB,MAAM,OAAO,QAAQ,GACzD,UAAA;AAAA,YAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC;AAAA,gBACA,IAAI;AAAA,gBACJ;AAAA,gBACA,oBAAkB,aAAa,eAAe;AAAA,gBAC9C,gBAAc,SAAS;AAAA,gBACvB,WAAW;AAAA,kBACT,kBAAkB,MAAM,CAAC,CAAC,UAAU,CAAC,EAAE,aAAa,UAAU;AAAA,kBAC9D;AAAA,gBAAA;AAAA,gBAED,GAAG;AAAA,cAAA;AAAA,YAAA;AAAA,YAGL,YACC;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAW;AAAA,kBACT;AAAA,kBACA,WAAW,IAAI;AAAA,gBAAA;AAAA,gBAGjB,UAAA,oBAAC,OAAA,EAAI,WAAU,oDAAoD,UAAA,SAAA,CAAS;AAAA,cAAA;AAAA,YAAA;AAAA,aAI9E,aAAa,cACb;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAW;AAAA,kBACT;AAAA,kBACA,WAAW,IAAI;AAAA,gBAAA;AAAA,gBAGhB,UAAA;AAAA,kBAAA,aACC,oBAAC,OAAA,EAAI,WAAU,oDAAoD,UAAA,WAAU;AAAA,kBAE9E,iCACE,OAAA,EAAI,WAAU,wEACb,UAAA,oBAAC,kBAAA,EAAiB,WAAU,uBAAA,CAAuB,EAAA,CACrD;AAAA,gBAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UAEJ,GAEJ;AAAA,UAEC,cACC,oBAAC,qBAAA,EAAoB,IAAI,cAAc,OACpC,UAAA,WAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,UAAU,cAAc;"}
|
|
1
|
+
{"version":3,"file":"TextField.mjs","sources":["../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { CheckOutlineIcon } from \"@/index\";\nimport { cn } from \"../../utils/cn\";\n\n/** Text field height in pixels. */\nexport type TextFieldSize = \"48\" | \"40\" | \"32\";\n\nexport interface TextFieldProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\" | \"prefix\"> {\n /** Label text displayed above the input. Also used as the accessible name. */\n label?: string;\n /** Helper text displayed below the input. Replaced by `errorMessage` when `error` is `true`. */\n helperText?: string;\n /** Height of the text field in pixels. @default \"48\" */\n size?: TextFieldSize;\n /** Whether the text field is in an error state. @default false */\n error?: boolean;\n /** Error message displayed below the input. Shown instead of `helperText` when `error` is `true`. */\n errorMessage?: string;\n /** Whether the text field is validated. @default false */\n validated?: boolean;\n /** Icon element displayed at the left side of the input. */\n leftIcon?: React.ReactNode;\n /** Icon element displayed at the right side of the input. */\n rightIcon?: React.ReactNode;\n /** Fixed, non-editable label pinned inside the left edge of the field — for a prefix such as a currency symbol or country code. */\n leftLabel?: React.ReactNode;\n /** Fixed, non-editable label pinned inside the right edge of the field — for a unit or suffix such as a currency code or domain. */\n rightLabel?: React.ReactNode;\n /** Whether the text field stretches to fill its container width. @default false */\n fullWidth?: boolean;\n}\n\nconst CONTAINER_HEIGHT: Record<TextFieldSize, string> = {\n \"48\": \"h-12\",\n \"40\": \"h-10\",\n \"32\": \"h-8\",\n};\n\nconst CONTAINER_PADDING_X: Record<TextFieldSize, string> = {\n \"48\": \"px-4\",\n \"40\": \"px-4\",\n \"32\": \"px-3\",\n};\n\nconst CONTAINER_GAP: Record<TextFieldSize, string> = {\n \"48\": \"gap-2.5\",\n \"40\": \"gap-2.5\",\n \"32\": \"gap-2\",\n};\n\nconst INPUT_TYPOGRAPHY: Record<TextFieldSize, string> = {\n \"48\": \"typography-body-default-16px-regular autofill-body-lg\",\n \"40\": \"typography-body-default-16px-regular autofill-body-lg\",\n \"32\": \"typography-body-small-14px-regular autofill-body-md\",\n};\n\nconst SIDE_LABEL_TYPOGRAPHY: Record<TextFieldSize, string> = {\n \"48\": \"typography-body-default-16px-regular\",\n \"40\": \"typography-body-default-16px-regular\",\n \"32\": \"typography-body-small-14px-regular\",\n};\n\nfunction getContainerClassName(size: TextFieldSize, error: boolean, disabled?: boolean) {\n return cn(\n \"relative flex items-center overflow-hidden rounded-sm border bg-inputs-inputs-primary has-focus-visible:shadow-focus-ring has-focus-visible:outline-none motion-safe:transition-colors\",\n CONTAINER_PADDING_X[size],\n CONTAINER_GAP[size],\n error ? \"border-error-content\" : \"border-border-primary\",\n !disabled && !error && \"hover:border-neutral-alphas-400\",\n CONTAINER_HEIGHT[size],\n disabled && \"opacity-50\",\n );\n}\n\nfunction LeadingIcon({ children }: { children?: React.ReactNode }) {\n if (!children) return null;\n return (\n <span className=\"pointer-events-none flex size-4 shrink-0 items-center justify-center text-content-secondary\">\n {children}\n </span>\n );\n}\n\nfunction SideLabel({\n id,\n size,\n align,\n children,\n}: {\n id?: string;\n size: TextFieldSize;\n align: \"left\" | \"right\";\n children?: React.ReactNode;\n}) {\n if (!children) return null;\n return (\n <span\n id={id}\n className={cn(\n \"shrink-0 select-none whitespace-nowrap text-content-tertiary\",\n align === \"right\" && \"text-right\",\n SIDE_LABEL_TYPOGRAPHY[size],\n )}\n >\n {children}\n </span>\n );\n}\n\nfunction TrailingAdornment({\n rightIcon,\n validated,\n}: {\n rightIcon?: React.ReactNode;\n validated: boolean;\n}) {\n if (!rightIcon && !validated) return null;\n return (\n <span className=\"flex shrink-0 items-center gap-2 text-content-secondary\">\n {rightIcon && (\n <span data-tf-interactive=\"\" className=\"flex size-4 shrink-0 items-center justify-center\">\n {rightIcon}\n </span>\n )}\n {validated && (\n <span className=\"pointer-events-none flex size-4 shrink-0 items-center justify-center\">\n <CheckOutlineIcon className=\"text-success-content\" />\n </span>\n )}\n </span>\n );\n}\n\nfunction TextFieldHelperText({\n id,\n error,\n children,\n}: {\n id: string;\n error: boolean;\n children: React.ReactNode;\n}) {\n return (\n <p\n id={id}\n className={cn(\n \"typography-description-12px-regular px-2 pt-2 pb-0.5\",\n error ? \"text-error-content\" : \"text-content-secondary\",\n )}\n >\n {children}\n </p>\n );\n}\n\nfunction warnMissingAccessibleName(label?: string, ariaLabel?: string, ariaLabelledBy?: string) {\n if (process.env.NODE_ENV !== \"production\") {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n \"TextField: no accessible name provided. Pass a `label`, `aria-label`, or `aria-labelledby` prop.\",\n );\n }\n }\n}\n\n/**\n * A text input field with optional label, helper/error text, icon slots, and side labels.\n *\n * Use `leftLabel` / `rightLabel` for fixed unit or prefix affordances (currency symbol,\n * country code, domain suffix). Provide at least one of `label`, `aria-label`, or\n * `aria-labelledby` for accessibility — a console warning is emitted in development if none are set.\n *\n * @example\n * ```tsx\n * <TextField\n * label=\"Email\"\n * placeholder=\"you@example.com\"\n * error={!!emailError}\n * errorMessage={emailError}\n * />\n * ```\n *\n * @example\n * ```tsx\n * <TextField label=\"Price\" leftLabel=\"$\" rightLabel=\"USD\" placeholder=\"0.00\" />\n * ```\n */\nexport const TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n label,\n helperText,\n size = \"48\",\n error = false,\n errorMessage,\n validated = false,\n leftIcon,\n rightIcon,\n leftLabel,\n rightLabel,\n className,\n id,\n disabled,\n fullWidth = false,\n ...props\n },\n ref,\n ) => {\n const generatedId = React.useId();\n const inputId = id || generatedId;\n const helperTextId = `${inputId}-helper`;\n const leftLabelId = `${inputId}-left-label`;\n const rightLabelId = `${inputId}-right-label`;\n const bottomText = error && errorMessage ? errorMessage : helperText;\n\n const describedBy =\n [\n leftLabel != null ? leftLabelId : null,\n rightLabel != null ? rightLabelId : null,\n bottomText ? helperTextId : null,\n ]\n .filter(Boolean)\n .join(\" \") || undefined;\n\n const innerRef = React.useRef<HTMLInputElement>(null);\n const setRefs = React.useCallback(\n (node: HTMLInputElement | null) => {\n innerRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) (ref as React.MutableRefObject<HTMLInputElement | null>).current = node;\n },\n [ref],\n );\n\n // Keep clicks on the non-interactive adornments (icons, side labels, padding)\n // focusing the input, matching the old absolute/pointer-events-none layout.\n const handleContainerMouseDown = (event: React.MouseEvent<HTMLDivElement>) => {\n if (disabled) return;\n const target = event.target as HTMLElement;\n if (target === innerRef.current) return;\n if (target.closest(\"[data-tf-interactive]\")) return;\n event.preventDefault();\n innerRef.current?.focus();\n };\n\n warnMissingAccessibleName(label, props[\"aria-label\"], props[\"aria-labelledby\"]);\n\n return (\n <div\n className={cn(\"flex flex-col\", fullWidth && \"w-full\", className)}\n data-disabled={disabled ? \"\" : undefined}\n data-error={error ? \"\" : undefined}\n >\n {label && (\n <label\n htmlFor={inputId}\n className=\"typography-description-12px-semibold pb-2 text-content-primary\"\n >\n {label}\n </label>\n )}\n\n {/* biome-ignore lint/a11y/noStaticElementInteractions: focus bridge delegates pointer clicks on adornments to the input */}\n <div\n className={getContainerClassName(size, error, disabled)}\n onMouseDown={handleContainerMouseDown}\n >\n <LeadingIcon>{leftIcon}</LeadingIcon>\n <SideLabel id={leftLabelId} size={size} align=\"left\">\n {leftLabel}\n </SideLabel>\n\n <input\n ref={setRefs}\n id={inputId}\n disabled={disabled}\n aria-describedby={describedBy}\n aria-invalid={error || undefined}\n className={cn(\n \"h-full min-w-0 flex-1 bg-transparent text-content-primary no-underline placeholder:text-content-tertiary focus:outline-none disabled:cursor-not-allowed\",\n INPUT_TYPOGRAPHY[size],\n \"[&[type='search']::-webkit-search-cancel-button]:hidden [&[type='search']::-webkit-search-cancel-button]:appearance-none\",\n )}\n {...props}\n />\n\n <SideLabel id={rightLabelId} size={size} align=\"right\">\n {rightLabel}\n </SideLabel>\n <TrailingAdornment rightIcon={rightIcon} validated={validated} />\n </div>\n\n {bottomText && (\n <TextFieldHelperText id={helperTextId} error={error}>\n {bottomText}\n </TextFieldHelperText>\n )}\n </div>\n );\n },\n);\n\nTextField.displayName = \"TextField\";\n"],"names":[],"mappings":";;;;;;AAiCA,MAAM,mBAAkD;AAAA,EACtD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,sBAAqD;AAAA,EACz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AAA,UAAA;AAAA,UAGhE,cACC,oBAAC,qBAAA,EAAoB,IAAI,cAAc,OACpC,UAAA,WAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,UAAU,cAAc;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -64,14 +64,26 @@ export declare type AccordionProps = React_2.ComponentPropsWithoutRef<typeof Acc
|
|
|
64
64
|
|
|
65
65
|
/** An interactive button that toggles the visibility of its associated {@link AccordionContent} panel. */
|
|
66
66
|
export declare const AccordionTrigger: React_2.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React_2.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
67
|
-
/**
|
|
67
|
+
/** Trailing indicator icon. Defaults to `ChevronDownIcon` (rotates when open). Pass `null` to suppress it. */
|
|
68
68
|
icon?: React_2.ReactNode | null;
|
|
69
|
+
/** Secondary line rendered under the title, for extra context. */
|
|
70
|
+
description?: React_2.ReactNode;
|
|
71
|
+
/** Leading icon shown before the title (sized to 16px). */
|
|
72
|
+
leadingIcon?: React_2.ReactNode;
|
|
73
|
+
/** Leading avatar shown before the title, for headers representing a person or account. Pass an `Avatar` sized to `24`. */
|
|
74
|
+
avatar?: React_2.ReactNode;
|
|
69
75
|
} & React_2.RefAttributes<HTMLButtonElement>>;
|
|
70
76
|
|
|
71
77
|
/** Props for the {@link AccordionTrigger} button component. */
|
|
72
78
|
export declare type AccordionTriggerProps = React_2.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger> & {
|
|
73
|
-
/**
|
|
79
|
+
/** Trailing indicator icon. Defaults to `ChevronDownIcon` (rotates when open). Pass `null` to suppress it. */
|
|
74
80
|
icon?: React_2.ReactNode | null;
|
|
81
|
+
/** Secondary line rendered under the title, for extra context. */
|
|
82
|
+
description?: React_2.ReactNode;
|
|
83
|
+
/** Leading icon shown before the title (sized to 16px). */
|
|
84
|
+
leadingIcon?: React_2.ReactNode;
|
|
85
|
+
/** Leading avatar shown before the title, for headers representing a person or account. Pass an `Avatar` sized to `24`. */
|
|
86
|
+
avatar?: React_2.ReactNode;
|
|
75
87
|
};
|
|
76
88
|
|
|
77
89
|
/**
|
|
@@ -320,6 +332,54 @@ export declare interface AudioFileRejection {
|
|
|
320
332
|
errors: AudioValidationError[];
|
|
321
333
|
}
|
|
322
334
|
|
|
335
|
+
/**
|
|
336
|
+
* A compact playback control for a single audio clip: a play/pause toggle, a
|
|
337
|
+
* static amplitude waveform that doubles as a seek scrubber, and elapsed/total
|
|
338
|
+
* timestamps. Designed to sit as an overlay on media thumbnails (Vault cards)
|
|
339
|
+
* as well as inline rows (the AI Voice Message "Generated Audio" row).
|
|
340
|
+
*
|
|
341
|
+
* The waveform is seeded from the decoded audio when possible, falling back
|
|
342
|
+
* to a deterministic (not random) placeholder derived from `src` so the
|
|
343
|
+
* result is stable across renders, SSR, and Chromatic snapshots.
|
|
344
|
+
*
|
|
345
|
+
* @example
|
|
346
|
+
* ```tsx
|
|
347
|
+
* <AudioPlayer src="https://example.com/clip.mp3" duration={5} />
|
|
348
|
+
* ```
|
|
349
|
+
*/
|
|
350
|
+
export declare const AudioPlayer: React_2.ForwardRefExoticComponent<AudioPlayerProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
351
|
+
|
|
352
|
+
export declare interface AudioPlayerProps extends Omit<React_2.HTMLAttributes<HTMLDivElement>, "onPlay" | "onPause" | "onEnded"> {
|
|
353
|
+
/** URL of the audio file to play. */
|
|
354
|
+
src: string;
|
|
355
|
+
/**
|
|
356
|
+
* Total duration in seconds, used to render the timestamp before the
|
|
357
|
+
* media's own metadata has loaded (and as a fallback if it never does).
|
|
358
|
+
*/
|
|
359
|
+
duration?: number;
|
|
360
|
+
/**
|
|
361
|
+
* Whether playback is active (controlled). Note: once `onEnded` fires, the
|
|
362
|
+
* browser has already stopped native playback. To loop or replay under
|
|
363
|
+
* controlled usage, toggle this prop `false` then `true` (rather than
|
|
364
|
+
* leaving it `true`) — the sync effect only calls `play()` again when this
|
|
365
|
+
* value actually changes.
|
|
366
|
+
*/
|
|
367
|
+
playing?: boolean;
|
|
368
|
+
/** Initial playback state (uncontrolled). @default false */
|
|
369
|
+
defaultPlaying?: boolean;
|
|
370
|
+
/** Called when playback starts. */
|
|
371
|
+
onPlay?: () => void;
|
|
372
|
+
/** Called when playback is paused. */
|
|
373
|
+
onPause?: () => void;
|
|
374
|
+
/** Called when playback reaches the end of the media. */
|
|
375
|
+
onEnded?: () => void;
|
|
376
|
+
/** Height of the player row, in pixels. @default "40" */
|
|
377
|
+
size?: AudioPlayerSize;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/** Height of the audio player row, in pixels. Matches both the Vault card overlay and the "Generated Audio" modal row in Figma — both use an identical 32px play button and 40px row. */
|
|
381
|
+
export declare type AudioPlayerSize = "40";
|
|
382
|
+
|
|
323
383
|
/**
|
|
324
384
|
* Audio file upload with drag-and-drop and optional in-browser recording.
|
|
325
385
|
* Supports file validation, multiple files, and real-time waveform visualization during recording.
|
|
@@ -1800,6 +1860,8 @@ export declare interface DialogContentProps extends React_2.ComponentPropsWithou
|
|
|
1800
1860
|
* @default "sheet"
|
|
1801
1861
|
*/
|
|
1802
1862
|
mobilePresentation?: "sheet" | "card";
|
|
1863
|
+
/** Props forwarded to the default {@link DialogOverlay} when `overlay` is `true`. */
|
|
1864
|
+
overlayProps?: DialogOverlayProps;
|
|
1803
1865
|
}
|
|
1804
1866
|
|
|
1805
1867
|
/** Accessible description for the dialog. Rendered as secondary text. */
|
|
@@ -2257,6 +2319,11 @@ export declare type DropdownMenuHeaderType = "default" | "search";
|
|
|
2257
2319
|
* <DropdownMenuItem destructive>Delete</DropdownMenuItem>
|
|
2258
2320
|
* <DropdownMenuItem leadingIcon={<EditIcon />}>Edit</DropdownMenuItem>
|
|
2259
2321
|
*
|
|
2322
|
+
* // Feature-rich row with an avatar and a trailing count
|
|
2323
|
+
* <DropdownMenuItem avatar={<Avatar size={24} src={src} />} count="12">
|
|
2324
|
+
* Jane Doe
|
|
2325
|
+
* </DropdownMenuItem>
|
|
2326
|
+
*
|
|
2260
2327
|
* // As a link
|
|
2261
2328
|
* <DropdownMenuItem asChild>
|
|
2262
2329
|
* <a href="/settings">Settings</a>
|
|
@@ -2270,10 +2337,18 @@ export declare interface DropdownMenuItemProps extends React_2.ComponentPropsWit
|
|
|
2270
2337
|
size?: DropdownMenuItemSize;
|
|
2271
2338
|
/** Applies the destructive (error) treatment. Use for irreversible actions. @default false */
|
|
2272
2339
|
destructive?: boolean;
|
|
2273
|
-
/** Icon (or other node) rendered before the label. */
|
|
2340
|
+
/** Icon (or other node) rendered before the label. Ignored when {@link DropdownMenuItemProps.avatar} is set. */
|
|
2274
2341
|
leadingIcon?: React_2.ReactNode;
|
|
2342
|
+
/**
|
|
2343
|
+
* Leading avatar rendered in place of {@link DropdownMenuItemProps.leadingIcon},
|
|
2344
|
+
* for rows that represent a person or account. Pass an `Avatar` sized to `24`.
|
|
2345
|
+
* Takes precedence over `leadingIcon`.
|
|
2346
|
+
*/
|
|
2347
|
+
avatar?: React_2.ReactNode;
|
|
2275
2348
|
/** Icon (or other node) rendered after the label. */
|
|
2276
2349
|
trailingIcon?: React_2.ReactNode;
|
|
2350
|
+
/** Trailing count or number (e.g. an unread total) rendered before {@link DropdownMenuItemProps.trailingIcon}. */
|
|
2351
|
+
count?: React_2.ReactNode;
|
|
2277
2352
|
/**
|
|
2278
2353
|
* Optional secondary text rendered on a second line below the label. When
|
|
2279
2354
|
* provided, the row switches to a two-line layout and the leading/trailing
|
|
@@ -2578,6 +2653,30 @@ export declare const FlashIcon: React_2.ForwardRefExoticComponent<BaseIconProps
|
|
|
2578
2653
|
/** Props for {@link FlashIcon}. See {@link BaseIconProps} for the shared shape. */
|
|
2579
2654
|
export declare type FlashIconProps = BaseIconProps;
|
|
2580
2655
|
|
|
2656
|
+
/**
|
|
2657
|
+
* A circular, elevated button for the single most important action on a
|
|
2658
|
+
* screen (e.g. creating new content). Unlike {@link IconButton}, it always
|
|
2659
|
+
* floats above page content with a drop shadow and is meant to be
|
|
2660
|
+
* positioned by the consumer (e.g. `fixed bottom-6 right-6`) rather than
|
|
2661
|
+
* inline in a toolbar or action row.
|
|
2662
|
+
*
|
|
2663
|
+
* Requires an accessible name — pass `aria-label` or `aria-labelledby`, since
|
|
2664
|
+
* the icon alone doesn't convey the action to screen readers.
|
|
2665
|
+
*
|
|
2666
|
+
* @example
|
|
2667
|
+
* ```tsx
|
|
2668
|
+
* <FloatingActionButton aria-label="Add content" className="fixed right-6 bottom-6">
|
|
2669
|
+
* <AddIcon />
|
|
2670
|
+
* </FloatingActionButton>
|
|
2671
|
+
* ```
|
|
2672
|
+
*/
|
|
2673
|
+
export declare const FloatingActionButton: React_2.ForwardRefExoticComponent<FloatingActionButtonProps & React_2.RefAttributes<HTMLButtonElement>>;
|
|
2674
|
+
|
|
2675
|
+
export declare interface FloatingActionButtonProps extends React_2.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
2676
|
+
/** Icon to render inside the button. Pass an icon component (e.g. `<AddIcon />`). */
|
|
2677
|
+
children: React_2.ReactNode;
|
|
2678
|
+
}
|
|
2679
|
+
|
|
2581
2680
|
/**
|
|
2582
2681
|
* Folder icon. Renders at sizes 16, 24, or 32 px with outlined and filled variants.
|
|
2583
2682
|
*
|
|
@@ -2680,6 +2779,19 @@ export declare const GoogleIcon: React_2.ForwardRefExoticComponent<React_2.SVGAt
|
|
|
2680
2779
|
className?: string;
|
|
2681
2780
|
} & React_2.RefAttributes<SVGSVGElement>>;
|
|
2682
2781
|
|
|
2782
|
+
/**
|
|
2783
|
+
* Grid view icon. Renders at sizes 16, 24, or 32 px.
|
|
2784
|
+
*
|
|
2785
|
+
* @example
|
|
2786
|
+
* ```tsx
|
|
2787
|
+
* <GridViewIcon size={24} />
|
|
2788
|
+
* ```
|
|
2789
|
+
*/
|
|
2790
|
+
export declare const GridViewIcon: React_2.ForwardRefExoticComponent<BaseIconProps & React_2.RefAttributes<SVGSVGElement>>;
|
|
2791
|
+
|
|
2792
|
+
/** Props for {@link GridViewIcon}. See {@link BaseIconProps} for the shared shape. */
|
|
2793
|
+
export declare type GridViewIconProps = BaseIconProps;
|
|
2794
|
+
|
|
2683
2795
|
/**
|
|
2684
2796
|
* Health icon. Renders at sizes 16, 24, or 32 px with outlined and filled variants.
|
|
2685
2797
|
*
|
|
@@ -3029,6 +3141,19 @@ export declare type LinkSize = "16" | "14";
|
|
|
3029
3141
|
/** Visual style variant of the link. */
|
|
3030
3142
|
export declare type LinkVariant = "primary" | "brand";
|
|
3031
3143
|
|
|
3144
|
+
/**
|
|
3145
|
+
* List view icon. Renders at sizes 16, 24, or 32 px.
|
|
3146
|
+
*
|
|
3147
|
+
* @example
|
|
3148
|
+
* ```tsx
|
|
3149
|
+
* <ListViewIcon size={24} />
|
|
3150
|
+
* ```
|
|
3151
|
+
*/
|
|
3152
|
+
export declare const ListViewIcon: React_2.ForwardRefExoticComponent<BaseIconProps & React_2.RefAttributes<SVGSVGElement>>;
|
|
3153
|
+
|
|
3154
|
+
/** Props for {@link ListViewIcon}. See {@link BaseIconProps} for the shared shape. */
|
|
3155
|
+
export declare type ListViewIconProps = BaseIconProps;
|
|
3156
|
+
|
|
3032
3157
|
/**
|
|
3033
3158
|
* A layout-aware loading indicator that renders a centered `SpinnerIcon` inside
|
|
3034
3159
|
* a relatively-positioned container. Drop-in replacement for the Olympus `Loader`.
|
|
@@ -3678,12 +3803,38 @@ export declare type ProfileStatusSize = "sm" | "md";
|
|
|
3678
3803
|
*/
|
|
3679
3804
|
export declare const ProgressBar: React_2.ForwardRefExoticComponent<ProgressBarProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
3680
3805
|
|
|
3806
|
+
/**
|
|
3807
|
+
* A single rounded segment used to compose a stepped progress indicator. Render
|
|
3808
|
+
* a row of these (see {@link ProgressBarSteps}) to represent discrete steps.
|
|
3809
|
+
*
|
|
3810
|
+
* @example
|
|
3811
|
+
* ```tsx
|
|
3812
|
+
* <ProgressBarItem active variant="brand" />
|
|
3813
|
+
* ```
|
|
3814
|
+
*/
|
|
3815
|
+
export declare const ProgressBarItem: React_2.ForwardRefExoticComponent<ProgressBarItemProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
3816
|
+
|
|
3817
|
+
export declare interface ProgressBarItemProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
3818
|
+
/** Whether this item is filled (completed). @default false */
|
|
3819
|
+
active?: boolean;
|
|
3820
|
+
/** Colour mode. @default "brand" */
|
|
3821
|
+
variant?: ProgressBarItemVariant;
|
|
3822
|
+
/** Pill thickness — `"default"` (8px) or `"small"` (4px). @default "default" */
|
|
3823
|
+
size?: ProgressBarItemSize;
|
|
3824
|
+
}
|
|
3825
|
+
|
|
3826
|
+
/** Pill thickness — `"default"` (8px) or `"small"` (4px). */
|
|
3827
|
+
export declare type ProgressBarItemSize = "default" | "small";
|
|
3828
|
+
|
|
3829
|
+
/** Colour mode for a progress bar item — brand green or theme-aware monochrome. */
|
|
3830
|
+
export declare type ProgressBarItemVariant = "brand" | "mono";
|
|
3831
|
+
|
|
3681
3832
|
export declare interface ProgressBarProps extends Omit<React_2.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
3682
3833
|
/** Current progress value, clamped to 0–100. */
|
|
3683
3834
|
value: number;
|
|
3684
3835
|
/** Track height — `"default"` (12px) or `"small"` (6px). @default "default" */
|
|
3685
3836
|
size?: ProgressBarSize;
|
|
3686
|
-
/** Colour mode
|
|
3837
|
+
/** Colour mode. Prefer `"brand"` or `"mono"` (V2); `"default"`/`"generic"`/`"neutral"` are legacy. @default "default" */
|
|
3687
3838
|
variant?: ProgressBarVariant;
|
|
3688
3839
|
/** Title content shown at the top-left of the bar. */
|
|
3689
3840
|
title?: React_2.ReactNode;
|
|
@@ -3706,8 +3857,41 @@ export declare interface ProgressBarProps extends Omit<React_2.HTMLAttributes<HT
|
|
|
3706
3857
|
/** Track height — `"default"` (12px) or `"small"` (6px). */
|
|
3707
3858
|
export declare type ProgressBarSize = "default" | "small";
|
|
3708
3859
|
|
|
3709
|
-
/**
|
|
3710
|
-
|
|
3860
|
+
/**
|
|
3861
|
+
* A segmented (stepped) progress indicator built from {@link ProgressBarItem}
|
|
3862
|
+
* pills. Fills the first `value` of `steps` segments.
|
|
3863
|
+
*
|
|
3864
|
+
* @example
|
|
3865
|
+
* ```tsx
|
|
3866
|
+
* <ProgressBarSteps steps={4} value={2} variant="brand" />
|
|
3867
|
+
* ```
|
|
3868
|
+
*/
|
|
3869
|
+
export declare const ProgressBarSteps: React_2.ForwardRefExoticComponent<ProgressBarStepsProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
3870
|
+
|
|
3871
|
+
export declare interface ProgressBarStepsProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
3872
|
+
/** Total number of steps (segments). Values below 1 are treated as 1. */
|
|
3873
|
+
steps: number;
|
|
3874
|
+
/** Number of completed steps, clamped to `0`–`steps`. */
|
|
3875
|
+
value: number;
|
|
3876
|
+
/** Colour mode. @default "brand" */
|
|
3877
|
+
variant?: ProgressBarItemVariant;
|
|
3878
|
+
/** Pill thickness — `"default"` (8px) or `"small"` (4px). @default "default" */
|
|
3879
|
+
size?: ProgressBarItemSize;
|
|
3880
|
+
/** Accessible label for the `progressbar` role. @default "Progress" */
|
|
3881
|
+
ariaLabel?: string;
|
|
3882
|
+
/** Human-readable text alternative for the current value (e.g. "Step 2 of 4"). */
|
|
3883
|
+
ariaValueText?: string;
|
|
3884
|
+
}
|
|
3885
|
+
|
|
3886
|
+
/**
|
|
3887
|
+
* Colour mode.
|
|
3888
|
+
* - `"brand"` — V2 brand (green) fill on a tinted track.
|
|
3889
|
+
* - `"mono"` — V2 monochrome fill on a tinted track (theme-aware).
|
|
3890
|
+
* - `"default"` — legacy value-coded red/yellow/green.
|
|
3891
|
+
* - `"generic"` — legacy solid brand green on a neutral track.
|
|
3892
|
+
* - `"neutral"` — legacy theme-aware inverse colour on a neutral track.
|
|
3893
|
+
*/
|
|
3894
|
+
export declare type ProgressBarVariant = "brand" | "mono" | "default" | "generic" | "neutral";
|
|
3711
3895
|
|
|
3712
3896
|
/**
|
|
3713
3897
|
* Queue icon. Renders at sizes 16, 24, or 32 px.
|
|
@@ -3987,15 +4171,46 @@ export declare type SearchIconProps = BaseIconProps;
|
|
|
3987
4171
|
* aria-label="Amount type"
|
|
3988
4172
|
* />
|
|
3989
4173
|
* ```
|
|
4174
|
+
*
|
|
4175
|
+
* @example Icon-only segments (e.g. a list/grid view toggle)
|
|
4176
|
+
* ```tsx
|
|
4177
|
+
* <SegmentedControl
|
|
4178
|
+
* appearance="plain"
|
|
4179
|
+
* options={[
|
|
4180
|
+
* { label: "List view", value: "list", icon: <ListViewIcon size={16} /> },
|
|
4181
|
+
* { label: "Grid view", value: "grid", icon: <GridViewIcon size={16} /> },
|
|
4182
|
+
* ]}
|
|
4183
|
+
* value={view}
|
|
4184
|
+
* onChange={setView}
|
|
4185
|
+
* aria-label="View"
|
|
4186
|
+
* />
|
|
4187
|
+
* ```
|
|
3990
4188
|
*/
|
|
3991
4189
|
export declare const SegmentedControl: React_2.ForwardRefExoticComponent<SegmentedControlProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
3992
4190
|
|
|
4191
|
+
/**
|
|
4192
|
+
* Visual style of the control.
|
|
4193
|
+
* - `"pill"`: the container has a muted background and the selected segment shows a filled pill (default).
|
|
4194
|
+
* - `"plain"`: no container or selected-pill background; segments are bare content and selection is
|
|
4195
|
+
* communicated by color alone. Designed for icon-only toggles (e.g. a list/grid view switch).
|
|
4196
|
+
*/
|
|
4197
|
+
export declare type SegmentedControlAppearance = "pill" | "plain";
|
|
4198
|
+
|
|
3993
4199
|
/** Describes one selectable segment. */
|
|
3994
4200
|
export declare interface SegmentedControlOption {
|
|
3995
|
-
/**
|
|
4201
|
+
/**
|
|
4202
|
+
* Display label for the segment. When `icon` is provided, the segment renders icon-only and
|
|
4203
|
+
* this value is used as its accessible name (applied as `aria-label`) instead of visible text.
|
|
4204
|
+
*/
|
|
3996
4205
|
label: string;
|
|
3997
4206
|
/** Value identifier returned via `onChange`. */
|
|
3998
4207
|
value: string;
|
|
4208
|
+
/**
|
|
4209
|
+
* Icon to render instead of the visible label. When set, the segment renders icon-only and
|
|
4210
|
+
* `label` becomes required as its accessible name — it is applied as `aria-label` and no
|
|
4211
|
+
* visible text is rendered.
|
|
4212
|
+
*/
|
|
4213
|
+
icon?: React_2.ReactNode;
|
|
3999
4214
|
}
|
|
4000
4215
|
|
|
4001
4216
|
export declare interface SegmentedControlProps extends Omit<React_2.HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
@@ -4003,6 +4218,8 @@ export declare interface SegmentedControlProps extends Omit<React_2.HTMLAttribut
|
|
|
4003
4218
|
size?: SegmentedControlSize;
|
|
4004
4219
|
/** Segment layout. @default "hug" */
|
|
4005
4220
|
variant?: SegmentedControlVariant;
|
|
4221
|
+
/** Visual style of the control. @default "pill" */
|
|
4222
|
+
appearance?: SegmentedControlAppearance;
|
|
4006
4223
|
/** The selectable segments. Designed for two or three mutually exclusive options. */
|
|
4007
4224
|
options: SegmentedControlOption[];
|
|
4008
4225
|
/** Currently selected value (controlled). */
|
|
@@ -5011,10 +5228,11 @@ export declare interface TextAreaProps extends Omit<React_2.TextareaHTMLAttribut
|
|
|
5011
5228
|
export declare type TextAreaSize = "48" | "40" | "32";
|
|
5012
5229
|
|
|
5013
5230
|
/**
|
|
5014
|
-
* A text input field with optional label, helper/error text, and
|
|
5231
|
+
* A text input field with optional label, helper/error text, icon slots, and side labels.
|
|
5015
5232
|
*
|
|
5016
|
-
*
|
|
5017
|
-
*
|
|
5233
|
+
* Use `leftLabel` / `rightLabel` for fixed unit or prefix affordances (currency symbol,
|
|
5234
|
+
* country code, domain suffix). Provide at least one of `label`, `aria-label`, or
|
|
5235
|
+
* `aria-labelledby` for accessibility — a console warning is emitted in development if none are set.
|
|
5018
5236
|
*
|
|
5019
5237
|
* @example
|
|
5020
5238
|
* ```tsx
|
|
@@ -5025,6 +5243,11 @@ export declare type TextAreaSize = "48" | "40" | "32";
|
|
|
5025
5243
|
* errorMessage={emailError}
|
|
5026
5244
|
* />
|
|
5027
5245
|
* ```
|
|
5246
|
+
*
|
|
5247
|
+
* @example
|
|
5248
|
+
* ```tsx
|
|
5249
|
+
* <TextField label="Price" leftLabel="$" rightLabel="USD" placeholder="0.00" />
|
|
5250
|
+
* ```
|
|
5028
5251
|
*/
|
|
5029
5252
|
export declare const TextField: React_2.ForwardRefExoticComponent<TextFieldProps & React_2.RefAttributes<HTMLInputElement>>;
|
|
5030
5253
|
|
|
@@ -5045,6 +5268,10 @@ export declare interface TextFieldProps extends Omit<React_2.InputHTMLAttributes
|
|
|
5045
5268
|
leftIcon?: React_2.ReactNode;
|
|
5046
5269
|
/** Icon element displayed at the right side of the input. */
|
|
5047
5270
|
rightIcon?: React_2.ReactNode;
|
|
5271
|
+
/** Fixed, non-editable label pinned inside the left edge of the field — for a prefix such as a currency symbol or country code. */
|
|
5272
|
+
leftLabel?: React_2.ReactNode;
|
|
5273
|
+
/** Fixed, non-editable label pinned inside the right edge of the field — for a unit or suffix such as a currency code or domain. */
|
|
5274
|
+
rightLabel?: React_2.ReactNode;
|
|
5048
5275
|
/** Whether the text field stretches to fill its container width. @default false */
|
|
5049
5276
|
fullWidth?: boolean;
|
|
5050
5277
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -5,6 +5,7 @@ import { AccordionContent } from "./components/Accordion/AccordionContent.mjs";
|
|
|
5
5
|
import { AccordionItem } from "./components/Accordion/AccordionItem.mjs";
|
|
6
6
|
import { AccordionTrigger } from "./components/Accordion/AccordionTrigger.mjs";
|
|
7
7
|
import { Alert } from "./components/Alert/Alert.mjs";
|
|
8
|
+
import { AudioPlayer } from "./components/AudioPlayer/AudioPlayer.mjs";
|
|
8
9
|
import { AudioUpload } from "./components/AudioUpload/AudioUpload.mjs";
|
|
9
10
|
import { useAudioRecorder } from "./components/AudioUpload/useAudioRecorder.mjs";
|
|
10
11
|
import { Autocomplete } from "./components/Autocomplete/Autocomplete.mjs";
|
|
@@ -30,6 +31,7 @@ import { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, Dr
|
|
|
30
31
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuHeader, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger } from "./components/DropdownMenu/DropdownMenu.mjs";
|
|
31
32
|
import { EmptyState } from "./components/EmptyState/EmptyState.mjs";
|
|
32
33
|
import { FanFollowerCount } from "./components/FanFollowerCount/FanFollowerCount.mjs";
|
|
34
|
+
import { FloatingActionButton } from "./components/FloatingActionButton/FloatingActionButton.mjs";
|
|
33
35
|
import { IconButton } from "./components/IconButton/IconButton.mjs";
|
|
34
36
|
import { AddIcon } from "./components/Icons/AddIcon.mjs";
|
|
35
37
|
import { AffiliatesIcon } from "./components/Icons/AffiliatesIcon.mjs";
|
|
@@ -103,6 +105,7 @@ import { GenderIcon } from "./components/Icons/GenderIcon.mjs";
|
|
|
103
105
|
import { GifIcon } from "./components/Icons/GifIcon.mjs";
|
|
104
106
|
import { GiftIcon } from "./components/Icons/GiftIcon.mjs";
|
|
105
107
|
import { GoogleIcon } from "./components/Icons/GoogleIcon.mjs";
|
|
108
|
+
import { GridViewIcon } from "./components/Icons/GridViewIcon.mjs";
|
|
106
109
|
import { HealthIcon } from "./components/Icons/HealthIcon.mjs";
|
|
107
110
|
import { HeartIcon } from "./components/Icons/HeartIcon.mjs";
|
|
108
111
|
import { HelpIcon } from "./components/Icons/HelpIcon.mjs";
|
|
@@ -115,6 +118,7 @@ import { InfoCircleIcon } from "./components/Icons/InfoCircleIcon.mjs";
|
|
|
115
118
|
import { InfoIcon } from "./components/Icons/InfoIcon.mjs";
|
|
116
119
|
import { LanguageIcon } from "./components/Icons/LanguageIcon.mjs";
|
|
117
120
|
import { LinkIcon } from "./components/Icons/LinkIcon.mjs";
|
|
121
|
+
import { ListViewIcon } from "./components/Icons/ListViewIcon.mjs";
|
|
118
122
|
import { LocationIcon } from "./components/Icons/LocationIcon.mjs";
|
|
119
123
|
import { LockerIcon } from "./components/Icons/LockerIcon.mjs";
|
|
120
124
|
import { LockerOffIcon } from "./components/Icons/LockerOffIcon.mjs";
|
|
@@ -209,6 +213,8 @@ import { Pill } from "./components/Pill/Pill.mjs";
|
|
|
209
213
|
import { ProfileOnlineStatus } from "./components/ProfileOnlineStatus/ProfileOnlineStatus.mjs";
|
|
210
214
|
import { ProfileStatus } from "./components/ProfileStatus/ProfileStatus.mjs";
|
|
211
215
|
import { ProgressBar } from "./components/ProgressBar/ProgressBar.mjs";
|
|
216
|
+
import { ProgressBarItem } from "./components/ProgressBar/ProgressBarItem.mjs";
|
|
217
|
+
import { ProgressBarSteps } from "./components/ProgressBar/ProgressBarSteps.mjs";
|
|
212
218
|
import { Radio } from "./components/Radio/Radio.mjs";
|
|
213
219
|
import { RadioGroup } from "./components/RadioGroup/RadioGroup.mjs";
|
|
214
220
|
import { RatingSummary } from "./components/RatingSummary/RatingSummary.mjs";
|
|
@@ -260,6 +266,7 @@ export {
|
|
|
260
266
|
ArrowUpIcon,
|
|
261
267
|
ArrowUpRightIcon,
|
|
262
268
|
AtSignIcon,
|
|
269
|
+
AudioPlayer,
|
|
263
270
|
AudioUpload,
|
|
264
271
|
AutoMessageIcon,
|
|
265
272
|
Autocomplete,
|
|
@@ -373,6 +380,7 @@ export {
|
|
|
373
380
|
FlagIcon,
|
|
374
381
|
FlameIcon,
|
|
375
382
|
FlashIcon,
|
|
383
|
+
FloatingActionButton,
|
|
376
384
|
FolderIcon,
|
|
377
385
|
ForwardIcon,
|
|
378
386
|
GalleryIcon,
|
|
@@ -381,6 +389,7 @@ export {
|
|
|
381
389
|
GifIcon,
|
|
382
390
|
GiftIcon,
|
|
383
391
|
GoogleIcon,
|
|
392
|
+
GridViewIcon,
|
|
384
393
|
HealthIcon,
|
|
385
394
|
HeartIcon,
|
|
386
395
|
HelpIcon,
|
|
@@ -399,6 +408,7 @@ export {
|
|
|
399
408
|
LanguageIcon,
|
|
400
409
|
Link,
|
|
401
410
|
LinkIcon,
|
|
411
|
+
ListViewIcon,
|
|
402
412
|
Loader,
|
|
403
413
|
LocationIcon,
|
|
404
414
|
LockerIcon,
|
|
@@ -438,6 +448,8 @@ export {
|
|
|
438
448
|
ProfileOnlineStatus,
|
|
439
449
|
ProfileStatus,
|
|
440
450
|
ProgressBar,
|
|
451
|
+
ProgressBarItem,
|
|
452
|
+
ProgressBarSteps,
|
|
441
453
|
QueueIcon,
|
|
442
454
|
Radio,
|
|
443
455
|
RadioGroup,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|