@plexui/ui 0.57.0 → 0.59.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.
Files changed (32) hide show
  1. package/dist/es/components/Dialog/Dialog.js +1 -1
  2. package/dist/es/components/Dialog/Dialog.js.map +1 -1
  3. package/dist/es/components/Kbd/Kbd.js +3 -0
  4. package/dist/es/components/Kbd/Kbd.js.map +1 -1
  5. package/dist/es/components/Kbd/KbdModifier.js +27 -0
  6. package/dist/es/components/Kbd/KbdModifier.js.map +1 -0
  7. package/dist/es/components/Kbd/index.js +1 -0
  8. package/dist/es/components/Kbd/index.js.map +1 -1
  9. package/dist/es/components/Progress/Progress.js +18 -1
  10. package/dist/es/components/Progress/Progress.js.map +1 -1
  11. package/dist/es/components/Progress/index.js +1 -1
  12. package/dist/es/components/Progress/index.js.map +1 -1
  13. package/dist/es/components/RollingNumber/RollingNumber.js +41 -0
  14. package/dist/es/components/RollingNumber/RollingNumber.js.map +1 -0
  15. package/dist/es/components/RollingNumber/index.js +2 -0
  16. package/dist/es/components/RollingNumber/index.js.map +1 -0
  17. package/dist/es/components/Select/Select.js +6 -3
  18. package/dist/es/components/Select/Select.js.map +1 -1
  19. package/dist/es/components/Textarea/Textarea.js +3 -3
  20. package/dist/es/components/Textarea/Textarea.js.map +1 -1
  21. package/dist/es/lib/observeTextareaWidth.js +6 -0
  22. package/dist/es/lib/observeTextareaWidth.js.map +1 -1
  23. package/dist/types/components/Kbd/Kbd.d.ts +2 -0
  24. package/dist/types/components/Kbd/KbdModifier.d.ts +18 -0
  25. package/dist/types/components/Kbd/index.d.ts +1 -0
  26. package/dist/types/components/Progress/Progress.d.ts +26 -1
  27. package/dist/types/components/Progress/index.d.ts +1 -1
  28. package/dist/types/components/RollingNumber/RollingNumber.d.ts +25 -0
  29. package/dist/types/components/RollingNumber/index.d.ts +1 -0
  30. package/dist/types/components/Select/Select.d.ts +6 -0
  31. package/dist/types/lib/observeTextareaWidth.d.ts +6 -0
  32. package/package.json +2 -2
@@ -4,7 +4,7 @@ import clsx from "clsx";
4
4
  import { useCallback, useEffect, useId, useRef, useState } from "react";
5
5
  import { mergeRefs } from "react-merge-refs";
6
6
  import { toCssVariables } from "../../lib/helpers.js";
7
- import { observeTextareaWidth } from "../../lib/observeTextareaWidth.js";
7
+ import { observeTextareaWidth, sizesByContent } from "../../lib/observeTextareaWidth.js";
8
8
  import {} from "../../types.js";
9
9
  import s from "@plexui/styles/components/Textarea/Textarea.module.css";
10
10
  export const Textarea = (props) => {
@@ -30,14 +30,14 @@ export const Textarea = (props) => {
30
30
  }
31
31
  };
32
32
  const autosizeTextarea = useCallback(() => {
33
- if (!autoResize || !textAreaRef.current || computedMaxRows === undefined)
33
+ if (!autoResize || !textAreaRef.current || computedMaxRows === undefined || sizesByContent())
34
34
  return;
35
35
  textAreaRef.current.style.height = "0px";
36
36
  const scrollHeight = textAreaRef.current.scrollHeight;
37
37
  textAreaRef.current.style.height = scrollHeight + "px";
38
38
  }, [autoResize, computedMaxRows]);
39
39
  useEffect(() => {
40
- if (!autoResize || !textAreaRef.current)
40
+ if (!autoResize || !textAreaRef.current || sizesByContent())
41
41
  return;
42
42
  return observeTextareaWidth(textAreaRef.current, autosizeTextarea);
43
43
  }, [autoResize, autosizeTextarea]);
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.js","sourceRoot":"","sources":["../../../../src/components/Textarea/Textarea.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAA;AACrE,OAAO,EAA+C,MAAM,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ef, useState } from \"react\"\nimport { mergeRefs } from \"react-merge-refs\"\nimport { toCssVariables } from \"../../lib/helpers\"\nimport { observeTextareaWidth } from \"../../lib/observeTextareaWidth\"\nimport { type ControlSize, type Sizes, type Variants } from \"../../types\"\nimport s from \"@plexui/styles/components/Textarea/Textarea.module.css\"\n\nexport type TextareaProps = {\n /**\n * Visual style of the textarea\n * @default outline\n */\n variant?: Variants<\"outline\" | \"soft\" | \"ghost\">\n /**\n * Controls the size of the textarea\n *\n * | 3xs | 2xs | xs | sm | md | lg | xl | 2xl | 3xl |\n * | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- |\n * | `22px` | `24px` | `26px` | `28px` | `32px` | `36px` | `40px` | `44px` | `48px` |\n *\n * @default md\n */\n size?: ControlSize\n /**\n * Applies a negative margin using the current gutter to optically align the text with surrounding content.\n */\n opticallyAlign?: \"start\" | \"end\"\n /**\n * Controls gutter on the edges of the textarea, defaults to value from `size`.\n *\n * | 2xs | xs | sm | md | lg | xl |\n * | ------ | ------ | ------ | ------ | ------ | ------ |\n * | `6px` | `8px` | `10px` | `12px` | `14px` | `16px` |\n */\n gutterSize?: Sizes<\"2xs\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\">\n /**\n * Disables the textarea visually and from interactions\n * @default false\n */\n disabled?: boolean\n /**\n * Mark the textarea as invalid\n * @default false\n */\n invalid?: boolean\n /**\n * Allow autofill extensions to appear in the textarea\n * @default false\n */\n allowAutofillExtensions?: boolean\n /**\n * Select all contents of the textarea when mounted.\n * @default false\n */\n autoSelect?: boolean\n /** Callback invoked when the textarea is autofilled by the browser */\n onAutofill?: () => void\n /**\n * Default number of rows to display\n * @default 3\n */\n rows?: number\n /**\n * Automatically adjust the height of the textarea based on its contents.\n * @default false\n */\n autoResize?: boolean\n /**\n * Maximum number of rows that can be displayed when autoResize is enabled.\n * @default Math.max(rows, 10)\n */\n maxRows?: number\n /** Ref for the textarea */\n ref?: React.Ref<HTMLTextAreaElement | null>\n} & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, \"disabled\" | \"size\">\n\nexport const Textarea = (props: TextareaProps) => {\n const textAreaRef = useRef<HTMLTextAreaElement | null>(null)\n const inputIdSuffix = useId()\n // Prevent 1Password from appearing: 1Password won't display if it thinks this field is for searching\n // Allow user to override this for connecting to labels.\n const onePasswordPreventionId = `search-ui-input-${inputIdSuffix}`\n const {\n id,\n name,\n variant = \"outline\",\n size = \"md\",\n opticallyAlign,\n gutterSize,\n className,\n autoComplete,\n disabled = false,\n readOnly = false,\n invalid = false,\n // Default to `true` when presence of `name`\n allowAutofillExtensions = !!name,\n onFocus,\n onBlur,\n onAnimationStart,\n onAutofill,\n autoSelect,\n rows = 3,\n maxRows,\n autoResize,\n ref,\n onChange,\n ...restProps\n } = props\n\n const [focused, setFocused] = useState<boolean>(false)\n const computedMaxRows = autoResize ? Math.max(maxRows ?? 10, rows) : rows\n\n useEffect(() => {\n if (autoSelect) {\n textAreaRef.current?.select()\n }\n }, [autoSelect])\n\n const handleAnimationStart = (evt: React.AnimationEvent<HTMLTextAreaElement>) => {\n onAnimationStart?.(evt)\n if (evt.animationName === \"native-autofill-in\") {\n onAutofill?.()\n }\n }\n\n const autosizeTextarea = useCallback(() => {\n if (!autoResize || !textAreaRef.current || computedMaxRows === undefined) return\n textAreaRef.current.style.height = \"0px\"\n const scrollHeight = textAreaRef.current.scrollHeight\n textAreaRef.current.style.height = scrollHeight + \"px\"\n }, [autoResize, computedMaxRows])\n\n useEffect(() => {\n if (!autoResize || !textAreaRef.current) return\n return observeTextareaWidth(textAreaRef.current, autosizeTextarea)\n }, [autoResize, autosizeTextarea])\n\n // Resize if value changes outside of user input - e.g. form reset\n useEffect(() => {\n autosizeTextarea()\n }, [props.value, rows, autosizeTextarea])\n\n return (\n <div\n className={clsx(s.Container, className)}\n data-slot=\"textarea\"\n data-variant={variant}\n data-size={size}\n data-optically-align={opticallyAlign}\n data-gutter-size={gutterSize}\n data-focused={focused}\n data-disabled={disabled ? \"\" : undefined}\n data-readonly={readOnly ? \"\" : undefined}\n data-invalid={invalid ? \"\" : undefined}\n data-auto-resize={autoResize ? \"\" : undefined}\n style={toCssVariables({\n \"textarea-min-rows\": `${rows}`,\n \"textarea-max-rows\": `${computedMaxRows}`,\n })}\n >\n <textarea\n {...restProps}\n onChange={(evt) => {\n onChange?.(evt)\n autosizeTextarea()\n }}\n ref={mergeRefs([textAreaRef, ref])}\n id={id || (allowAutofillExtensions ? undefined : onePasswordPreventionId)}\n className={s.Textarea}\n name={name}\n autoComplete={autoComplete}\n // Expose the visual invalid state to assistive tech; an explicit aria-invalid wins\n aria-invalid={restProps[\"aria-invalid\"] ?? (invalid || undefined)}\n readOnly={readOnly}\n disabled={disabled}\n rows={rows}\n onFocus={(evt) => {\n setFocused(true)\n onFocus?.(evt)\n }}\n onBlur={(evt) => {\n setFocused(false)\n onBlur?.(evt)\n }}\n onAnimationStart={handleAnimationStart}\n // Prevent LastPass and 1Password from appearing\n data-lpignore={allowAutofillExtensions ? undefined : true}\n data-1p-ignore={allowAutofillExtensions ? undefined : true}\n />\n </div>\n )\n}\n"]}
1
+ {"version":3,"file":"Textarea.js","sourceRoot":"","sources":["../../../../src/components/Textarea/Textarea.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACrF,OAAO,EAA+C,MAAM,aAAa,CAAA;AACzE,OAAO,CAAC,MAAM,wDAAwD,CAAA;AAuEtE,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAoB,EAAE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,CAAC;YACpB,mBAAmB,EAAE,GAAG,IAAI,EAAE;YAC9B,mBAAmB,EAAE,GAAG,eAAe,EAAE;SAC1C,CAAC,YAEF,sBACM,SAAS,EACb,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE;gBAChB,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAA;gBACf,gBAAgB,EAAE,CAAA;YACpB,CAAC,EACD,GAAG,EAAE,SAAS,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,EAClC,EAAE,EAAE,EAAE,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,uBAAuB,CAAC,EACzE,SAAS,EAAE,CAAC,CAAC,QAAQ,EACrB,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,YAAY,kBAEZ,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,IAAI,SAAS,CAAC,EACjE,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;gBACf,UAAU,CAAC,IAAI,CAAC,CAAA;gBAChB,OAAO,EAAE,CAAC,GAAG,CAAC,CAAA;YAChB,CAAC,EACD,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE;gBACd,UAAU,CAAC,KAAK,CAAC,CAAA;gBACjB,MAAM,EAAE,CAAC,GAAG,CAAC,CAAA;YACf,CAAC,EACD,gBAAgB,EAAE,oBAAoB,mBAEvB,uBAAuB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,oBACzC,uBAAuB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,GAC1D,GACE,CACP,CAAA;AACH,CAAC,CAAA","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport { useCallback, useEffect, useId, useRef, useState } from \"react\"\nimport { mergeRefs } from \"react-merge-refs\"\nimport { toCssVariables } from \"../../lib/helpers\"\nimport { observeTextareaWidth, sizesByContent } from \"../../lib/observeTextareaWidth\"\nimport { type ControlSize, type Sizes, type Variants } from \"../../types\"\nimport s from \"@plexui/styles/components/Textarea/Textarea.module.css\"\n\nexport type TextareaProps = {\n /**\n * Visual style of the textarea\n * @default outline\n */\n variant?: Variants<\"outline\" | \"soft\" | \"ghost\">\n /**\n * Controls the size of the textarea\n *\n * | 3xs | 2xs | xs | sm | md | lg | xl | 2xl | 3xl |\n * | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- |\n * | `22px` | `24px` | `26px` | `28px` | `32px` | `36px` | `40px` | `44px` | `48px` |\n *\n * @default md\n */\n size?: ControlSize\n /**\n * Applies a negative margin using the current gutter to optically align the text with surrounding content.\n */\n opticallyAlign?: \"start\" | \"end\"\n /**\n * Controls gutter on the edges of the textarea, defaults to value from `size`.\n *\n * | 2xs | xs | sm | md | lg | xl |\n * | ------ | ------ | ------ | ------ | ------ | ------ |\n * | `6px` | `8px` | `10px` | `12px` | `14px` | `16px` |\n */\n gutterSize?: Sizes<\"2xs\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\">\n /**\n * Disables the textarea visually and from interactions\n * @default false\n */\n disabled?: boolean\n /**\n * Mark the textarea as invalid\n * @default false\n */\n invalid?: boolean\n /**\n * Allow autofill extensions to appear in the textarea\n * @default false\n */\n allowAutofillExtensions?: boolean\n /**\n * Select all contents of the textarea when mounted.\n * @default false\n */\n autoSelect?: boolean\n /** Callback invoked when the textarea is autofilled by the browser */\n onAutofill?: () => void\n /**\n * Default number of rows to display\n * @default 3\n */\n rows?: number\n /**\n * Automatically adjust the height of the textarea based on its contents.\n * @default false\n */\n autoResize?: boolean\n /**\n * Maximum number of rows that can be displayed when autoResize is enabled.\n * @default Math.max(rows, 10)\n */\n maxRows?: number\n /** Ref for the textarea */\n ref?: React.Ref<HTMLTextAreaElement | null>\n} & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, \"disabled\" | \"size\">\n\nexport const Textarea = (props: TextareaProps) => {\n const textAreaRef = useRef<HTMLTextAreaElement | null>(null)\n const inputIdSuffix = useId()\n // Prevent 1Password from appearing: 1Password won't display if it thinks this field is for searching\n // Allow user to override this for connecting to labels.\n const onePasswordPreventionId = `search-ui-input-${inputIdSuffix}`\n const {\n id,\n name,\n variant = \"outline\",\n size = \"md\",\n opticallyAlign,\n gutterSize,\n className,\n autoComplete,\n disabled = false,\n readOnly = false,\n invalid = false,\n // Default to `true` when presence of `name`\n allowAutofillExtensions = !!name,\n onFocus,\n onBlur,\n onAnimationStart,\n onAutofill,\n autoSelect,\n rows = 3,\n maxRows,\n autoResize,\n ref,\n onChange,\n ...restProps\n } = props\n\n const [focused, setFocused] = useState<boolean>(false)\n const computedMaxRows = autoResize ? Math.max(maxRows ?? 10, rows) : rows\n\n useEffect(() => {\n if (autoSelect) {\n textAreaRef.current?.select()\n }\n }, [autoSelect])\n\n const handleAnimationStart = (evt: React.AnimationEvent<HTMLTextAreaElement>) => {\n onAnimationStart?.(evt)\n if (evt.animationName === \"native-autofill-in\") {\n onAutofill?.()\n }\n }\n\n const autosizeTextarea = useCallback(() => {\n if (!autoResize || !textAreaRef.current || computedMaxRows === undefined || sizesByContent()) return\n textAreaRef.current.style.height = \"0px\"\n const scrollHeight = textAreaRef.current.scrollHeight\n textAreaRef.current.style.height = scrollHeight + \"px\"\n }, [autoResize, computedMaxRows])\n\n useEffect(() => {\n if (!autoResize || !textAreaRef.current || sizesByContent()) return\n return observeTextareaWidth(textAreaRef.current, autosizeTextarea)\n }, [autoResize, autosizeTextarea])\n\n // Resize if value changes outside of user input - e.g. form reset\n useEffect(() => {\n autosizeTextarea()\n }, [props.value, rows, autosizeTextarea])\n\n return (\n <div\n className={clsx(s.Container, className)}\n data-slot=\"textarea\"\n data-variant={variant}\n data-size={size}\n data-optically-align={opticallyAlign}\n data-gutter-size={gutterSize}\n data-focused={focused}\n data-disabled={disabled ? \"\" : undefined}\n data-readonly={readOnly ? \"\" : undefined}\n data-invalid={invalid ? \"\" : undefined}\n data-auto-resize={autoResize ? \"\" : undefined}\n style={toCssVariables({\n \"textarea-min-rows\": `${rows}`,\n \"textarea-max-rows\": `${computedMaxRows}`,\n })}\n >\n <textarea\n {...restProps}\n onChange={(evt) => {\n onChange?.(evt)\n autosizeTextarea()\n }}\n ref={mergeRefs([textAreaRef, ref])}\n id={id || (allowAutofillExtensions ? undefined : onePasswordPreventionId)}\n className={s.Textarea}\n name={name}\n autoComplete={autoComplete}\n // Expose the visual invalid state to assistive tech; an explicit aria-invalid wins\n aria-invalid={restProps[\"aria-invalid\"] ?? (invalid || undefined)}\n readOnly={readOnly}\n disabled={disabled}\n rows={rows}\n onFocus={(evt) => {\n setFocused(true)\n onFocus?.(evt)\n }}\n onBlur={(evt) => {\n setFocused(false)\n onBlur?.(evt)\n }}\n onAnimationStart={handleAnimationStart}\n // Prevent LastPass and 1Password from appearing\n data-lpignore={allowAutofillExtensions ? undefined : true}\n data-1p-ignore={allowAutofillExtensions ? undefined : true}\n />\n </div>\n )\n}\n"]}
@@ -46,4 +46,10 @@ export const observeTextareaWidth = (element, resize) => {
46
46
  view?.removeEventListener("resize", onResize);
47
47
  };
48
48
  };
49
+ /**
50
+ * Whether the browser sizes an auto-resizing textarea itself (`field-sizing: content`, Safari 26+, Chrome 123+): then
51
+ * the style sheet holds it between its rows and maximum rows, and no script measures it. Measuring set the height to
52
+ * 0 and read scrollHeight, a forced layout on mount of every such textarea.
53
+ */
54
+ export const sizesByContent = () => typeof CSS !== "undefined" && typeof CSS.supports === "function" && CSS.supports("field-sizing", "content");
49
55
  //# sourceMappingURL=observeTextareaWidth.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"observeTextareaWidth.js","sourceRoot":"","sources":["../../../src/lib/observeTextareaWidth.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,OAAoB,EAAE,MAAkB,EAAgB,EAAE;IAC7F,MAAM,IAAI,GAAG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CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAA;QACnD,IAAI,CAAC,MAAM,IAAI,KAAK,KAAK,aAAa;YAAE,OAAM;QAC9C,aAAa,GAAG,KAAK,CAAA;QACrB,MAAM,EAAE,CAAA;IACV,CAAC,CAAA;IACD,IAAI,EAAE,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAC1C,OAAO,GAAG,EAAE;QACV,MAAM,GAAG,KAAK,CAAA;QACd,IAAI,EAAE,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAC/C,CAAC,CAAA;AACH,CAAC,CAAA","sourcesContent":["/** Observe width only; autosizing height must not feed back into the observer. */\nexport const observeTextareaWidth = (element: HTMLElement, resize: () => void): (() => void) => {\n const view = element.ownerDocument.defaultView\n let active = true\n let frame: number | undefined\n let previousWidth: number | undefined\n\n if (typeof ResizeObserver !== \"undefined\") {\n const observer = new ResizeObserver((entries) => {\n const entry = entries.find(({ target }) => target === element)\n if (!active || !entry || entry.contentRect.width === previousWidth) return\n previousWidth = entry.contentRect.width\n if (frame !== undefined) return\n // Write height outside ResizeObserver delivery to avoid a resize loop.\n if (view) {\n frame = view.requestAnimationFrame(() => {\n frame = undefined\n if (active) resize()\n })\n } else {\n resize()\n }\n })\n observer.observe(element)\n return () => {\n active = false\n observer.disconnect()\n if (frame !== undefined) view?.cancelAnimationFrame(frame)\n }\n }\n\n previousWidth = element.getBoundingClientRect().width\n const onResize = () => {\n const width = element.getBoundingClientRect().width\n if (!active || width === previousWidth) return\n previousWidth = width\n resize()\n }\n view?.addEventListener(\"resize\", onResize)\n return () => {\n active = false\n view?.removeEventListener(\"resize\", onResize)\n }\n}\n"]}
1
+ {"version":3,"file":"observeTextareaWidth.js","sourceRoot":"","sources":["../../../src/lib/observeTextareaWidth.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,OAAoB,EAAE,MAAkB,EAAgB,EAAE;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MAAM,KAAK,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAA;QACnD,IAAI,CAAC,MAAM,IAAI,KAAK,KAAK,aAAa;YAAE,OAAM;QAC9C,aAAa,GAAG,KAAK,CAAA;QACrB,MAAM,EAAE,CAAA;IACV,CAAC,CAAA;IACD,IAAI,EAAE,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAC1C,OAAO,GAAG,EAAE;QACV,MAAM,GAAG,KAAK,CAAA;QACd,IAAI,EAAE,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAC/C,CAAC,CAAA;AACH,CAAC,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,GAAY,EAAE,CAC1C,OAAO,GAAG,KAAK,WAAW,IAAI,OAAO,GAAG,CAAC,QAAQ,KAAK,UAAU,IAAI,GAAG,CAAC,QAAQ,CAAC,cAAc,EAAE,SAAS,CAAC,CAAA","sourcesContent":["/** Observe width only; autosizing height must not feed back into the observer. */\nexport const observeTextareaWidth = (element: HTMLElement, resize: () => void): (() => void) => {\n const view = element.ownerDocument.defaultView\n let active = true\n let frame: number | undefined\n let previousWidth: number | undefined\n\n if (typeof ResizeObserver !== \"undefined\") {\n const observer = new ResizeObserver((entries) => {\n const entry = entries.find(({ target }) => target === element)\n if (!active || !entry || entry.contentRect.width === previousWidth) return\n previousWidth = entry.contentRect.width\n if (frame !== undefined) return\n // Write height outside ResizeObserver delivery to avoid a resize loop.\n if (view) {\n frame = view.requestAnimationFrame(() => {\n frame = undefined\n if (active) resize()\n })\n } else {\n resize()\n }\n })\n observer.observe(element)\n return () => {\n active = false\n observer.disconnect()\n if (frame !== undefined) view?.cancelAnimationFrame(frame)\n }\n }\n\n previousWidth = element.getBoundingClientRect().width\n const onResize = () => {\n const width = element.getBoundingClientRect().width\n if (!active || width === previousWidth) return\n previousWidth = width\n resize()\n }\n view?.addEventListener(\"resize\", onResize)\n return () => {\n active = false\n view?.removeEventListener(\"resize\", onResize)\n }\n}\n\n/**\n * Whether the browser sizes an auto-resizing textarea itself (`field-sizing: content`, Safari 26+, Chrome 123+): then\n * the style sheet holds it between its rows and maximum rows, and no script measures it. Measuring set the height to\n * 0 and read scrollHeight, a forced layout on mount of every such textarea.\n */\nexport const sizesByContent = (): boolean =>\n typeof CSS !== \"undefined\" && typeof CSS.supports === \"function\" && CSS.supports(\"field-sizing\", \"content\")\n"]}
@@ -16,5 +16,7 @@ export type KbdProps = ComponentProps<"kbd"> & {
16
16
  export declare const Kbd: {
17
17
  ({ size, variant, className, ...restProps }: KbdProps): import("react/jsx-runtime").JSX.Element;
18
18
  Group: ({ className, ...restProps }: KbdGroupProps) => import("react/jsx-runtime").JSX.Element;
19
+ /** A modifier key as the reader's keyboard prints it: ⌘ on a Mac, Ctrl elsewhere (`name` picks ⌘, ⌃, ⌥ or ⇧). */
20
+ Modifier: ({ name, platform, size, variant, className, ...restProps }: import("./KbdModifier.js").KbdModifierProps) => import("react/jsx-runtime").JSX.Element;
19
21
  };
20
22
  export type KbdGroupProps = ComponentProps<"span">;
@@ -0,0 +1,18 @@
1
+ import type { KbdProps } from "./Kbd.js";
2
+ export type KbdModifierName = "mod" | "ctrl" | "alt" | "shift";
3
+ export type KbdPlatform = "apple" | "other";
4
+ /** Each modifier on an Apple keyboard (a symbol and its name) and on another one. `mod` is ⌘ there and Ctrl here. */
5
+ export declare const KBD_MODIFIERS: Record<KbdModifierName, Record<KbdPlatform, {
6
+ symbol: string;
7
+ name: string;
8
+ }>>;
9
+ /** Whether the browser runs on a Mac, an iPhone or an iPad, whose keyboards print ⌘ and ⌥. */
10
+ export declare const isApplePlatform: () => boolean;
11
+ export type KbdModifierProps = Omit<KbdProps, "children"> & {
12
+ /** The modifier: `mod` is ⌘ on an Apple keyboard and Ctrl on another, as an app's shortcuts are. @default "mod" */
13
+ name?: KbdModifierName;
14
+ /** The keyboard to print for; by default the one the browser runs on (Apple on the server). */
15
+ platform?: KbdPlatform;
16
+ };
17
+ /** A modifier key printed as the reader's keyboard prints it: ⌘ on a Mac, Ctrl elsewhere; its name is read out. */
18
+ export declare const KbdModifier: ({ name, platform, size, variant, className, ...restProps }: KbdModifierProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1,2 @@
1
1
  export { Kbd, type KbdGroupProps, type KbdProps } from "./Kbd.js";
2
+ export { KBD_MODIFIERS, KbdModifier, isApplePlatform, type KbdModifierName, type KbdModifierProps, type KbdPlatform } from "./KbdModifier.js";
@@ -1,5 +1,14 @@
1
1
  import { type ComponentProps } from "react";
2
2
  import { Progress as RadixProgress } from "radix-ui";
3
+ export type ProgressColor = "primary" | "secondary" | "success" | "warning" | "caution" | "danger" | "info" | "discovery";
4
+ /** A part of a segmented bar: its share of `max`, its color, and the name it is read with. */
5
+ export type ProgressSegment = {
6
+ value: number;
7
+ /** @default "primary" */
8
+ color?: ProgressColor;
9
+ /** Read out with its share, such as "Paid 60%" */
10
+ label?: string;
11
+ };
3
12
  export type ProgressProps = Omit<ComponentProps<typeof RadixProgress.Root>, "children"> & {
4
13
  /**
5
14
  * Current progress value, between `0` and `max`.
@@ -11,6 +20,22 @@ export type ProgressProps = Omit<ComponentProps<typeof RadixProgress.Root>, "chi
11
20
  * @default 100
12
21
  */
13
22
  max?: number;
23
+ /**
24
+ * Parts of one bar, side by side in their colors, such as paid, pending and due. The value is their sum; they
25
+ * take `value`'s place. A part's share is clamped so the bar never passes `max`.
26
+ */
27
+ segments?: ProgressSegment[];
14
28
  className?: string;
15
29
  };
16
- export declare const Progress: ({ value, max, className, ...restProps }: ProgressProps) => import("react/jsx-runtime").JSX.Element;
30
+ /** The parts of a segmented bar, each clamped so their sum stays within `max`, and their sum. */
31
+ export declare const progressSegments: (segments: ProgressSegment[], max: number) => {
32
+ parts: {
33
+ value: number;
34
+ /** @default "primary" */
35
+ color?: ProgressColor;
36
+ /** Read out with its share, such as "Paid 60%" */
37
+ label?: string;
38
+ }[];
39
+ total: number;
40
+ };
41
+ export declare const Progress: ({ value, max, segments, className, ...restProps }: ProgressProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- export { Progress, type ProgressProps } from "./Progress.js";
1
+ export { Progress, progressSegments, type ProgressColor, type ProgressProps, type ProgressSegment } from "./Progress.js";
@@ -0,0 +1,25 @@
1
+ import type { ComponentProps } from "react";
2
+ export type RollingNumberProps = Omit<ComponentProps<"span">, "children"> & {
3
+ /** The number shown. A new value rolls each changed digit to it. */
4
+ value: number;
5
+ /** The locale the number is written in, as `Intl.NumberFormat` takes it; fixed, so the server writes it as the browser does. @default "en-US" */
6
+ locales?: Intl.LocalesArgument;
7
+ /** How the number is written: currency, percent, fraction digits, grouping, as `Intl.NumberFormat` takes it. */
8
+ format?: Intl.NumberFormatOptions;
9
+ };
10
+ /** A written number's characters, each keyed by its place around the decimal separator, so a digit keeps its reel
11
+ * when the number grows or its fraction gets longer; digits are the locale's own (Arabic-Indic, Bengali…). */
12
+ export declare const rollingNumberParts: (value: number, locales?: Intl.LocalesArgument, format?: Intl.NumberFormatOptions) => {
13
+ text: string;
14
+ glyphs: string[];
15
+ characters: {
16
+ character: string;
17
+ digit: number | null;
18
+ key: string;
19
+ }[];
20
+ };
21
+ /**
22
+ * A number whose digits roll to a new value, as an odometer: for a total, a balance, a count or a KPI that changes
23
+ * while it is watched. It reads as the written number; its reels are hidden from a screen reader.
24
+ */
25
+ export declare const RollingNumber: ({ value, locales, format, className, ...restProps }: RollingNumberProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { RollingNumber, rollingNumberParts, type RollingNumberProps } from "./RollingNumber.js";
@@ -118,6 +118,12 @@ export type SelectProps<T extends Option> = (SingleSelectProps<T> | MultiSelectP
118
118
  * @default false, or true at the end of a `Field row`
119
119
  */
120
120
  pill?: boolean;
121
+ /**
122
+ * The list in the rounder shape of a pill menu (as `Menu.Content pill`), whatever the trigger: a custom `trigger` or a
123
+ * rounded field can open the same list as a pill one
124
+ * @default the trigger's `pill`
125
+ */
126
+ listPill?: boolean;
121
127
  /**
122
128
  * Text of a `multiple` trigger when every option is selected
123
129
  * @default All selected
@@ -1,2 +1,8 @@
1
1
  /** Observe width only; autosizing height must not feed back into the observer. */
2
2
  export declare const observeTextareaWidth: (element: HTMLElement, resize: () => void) => (() => void);
3
+ /**
4
+ * Whether the browser sizes an auto-resizing textarea itself (`field-sizing: content`, Safari 26+, Chrome 123+): then
5
+ * the style sheet holds it between its rows and maximum rows, and no script measures it. Measuring set the height to
6
+ * 0 and read scrollHeight, a forced layout on mount of every such textarea.
7
+ */
8
+ export declare const sizesByContent: () => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plexui/ui",
3
- "version": "0.57.0",
3
+ "version": "0.59.0",
4
4
  "description": "Modern design system for building high-quality applications",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -99,7 +99,7 @@
99
99
  "@maskito/core": "^5.2.2",
100
100
  "@maskito/kit": "^5.2.2",
101
101
  "@maskito/react": "^5.2.2",
102
- "@plexui/styles": "^0.15.0",
102
+ "@plexui/styles": "^0.16.1",
103
103
  "@radix-ui/react-dismissable-layer": "1.2.1",
104
104
  "@radix-ui/react-focus-guards": "1.2.0",
105
105
  "@radix-ui/react-focus-scope": "1.3.1",