@design-edito/tools 0.5.2 → 0.5.4

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 (152) hide show
  1. package/agnostic/html/deep-select/index.js +5 -3
  2. package/agnostic/html/hyper-json/smart-tags/coalesced/index.d.ts +9 -9
  3. package/agnostic/html/hyper-json/smart-tags/coalesced/index.js +9 -9
  4. package/agnostic/html/hyper-json/smart-tags/isolated/index.d.ts +3 -3
  5. package/agnostic/html/hyper-json/smart-tags/isolated/index.js +3 -3
  6. package/agnostic/html/index.d.ts +1 -1
  7. package/agnostic/html/index.js +1 -1
  8. package/agnostic/index.d.ts +2 -2
  9. package/agnostic/index.js +2 -2
  10. package/agnostic/misc/index.d.ts +3 -3
  11. package/agnostic/misc/index.js +3 -3
  12. package/agnostic/misc/logs/index.d.ts +1 -1
  13. package/agnostic/misc/logs/index.js +1 -1
  14. package/agnostic/numbers/index.d.ts +1 -1
  15. package/agnostic/numbers/index.js +1 -1
  16. package/agnostic/optim/index.d.ts +1 -1
  17. package/agnostic/optim/index.js +1 -1
  18. package/agnostic/strings/index.d.ts +2 -2
  19. package/agnostic/strings/index.js +2 -2
  20. package/agnostic/time/dates/format-date/index.d.ts +4 -2
  21. package/agnostic/time/dates/format-date/index.js +43 -94
  22. package/agnostic/time/dates/format-date/index.test.js +154 -0
  23. package/agnostic/time/dates/format-date/parts.d.ts +28 -0
  24. package/agnostic/time/dates/format-date/parts.js +136 -0
  25. package/agnostic/time/dates/format-date/types.d.ts +84 -0
  26. package/agnostic/time/dates/format-date/types.js +1 -0
  27. package/agnostic/time/duration/format-duration/index.d.ts +42 -0
  28. package/agnostic/time/duration/format-duration/index.js +94 -0
  29. package/agnostic/time/duration/format-duration/index.test.d.ts +1 -0
  30. package/agnostic/time/duration/format-duration/index.test.js +148 -0
  31. package/agnostic/time/duration/format-duration/parts.d.ts +32 -0
  32. package/agnostic/time/duration/format-duration/parts.js +107 -0
  33. package/agnostic/time/duration/format-duration/types.d.ts +93 -0
  34. package/agnostic/time/duration/format-duration/types.js +1 -0
  35. package/agnostic/time/duration/index.d.ts +6 -1
  36. package/agnostic/time/duration/index.js +2 -2
  37. package/agnostic/time/duration/index.test.d.ts +1 -0
  38. package/agnostic/time/duration/index.test.js +168 -0
  39. package/agnostic/time/index.d.ts +1 -1
  40. package/agnostic/time/index.js +1 -1
  41. package/components/BeforeAfter/index.controlled.d.ts +25 -25
  42. package/components/BeforeAfter/index.controlled.js +47 -53
  43. package/components/BeforeAfter/index.d.ts +20 -23
  44. package/components/BeforeAfter/index.js +48 -40
  45. package/components/Button/index.js +1 -1
  46. package/components/Clippable/index.d.ts +17 -26
  47. package/components/Clippable/index.js +21 -23
  48. package/components/Disclaimer/index.d.ts +32 -24
  49. package/components/Disclaimer/index.js +29 -24
  50. package/components/Drawer/index.d.ts +45 -25
  51. package/components/Drawer/index.js +61 -52
  52. package/components/EventListener/index.d.ts +4 -5
  53. package/components/Gallery/index.d.ts +14 -16
  54. package/components/Gallery/index.js +25 -30
  55. package/components/Iframe/index.js +2 -2
  56. package/components/Image/index.d.ts +5 -15
  57. package/components/Image/index.js +9 -34
  58. package/components/Input/index.d.ts +23 -19
  59. package/components/Input/index.js +30 -20
  60. package/components/JsonEditor/index.d.ts +177 -9
  61. package/components/JsonEditor/index.js +133 -77
  62. package/components/JsonEditor/types.d.ts +11 -0
  63. package/components/JsonEditor/types.js +1 -0
  64. package/components/JsonEditor/utils.d.ts +8 -0
  65. package/components/JsonEditor/utils.js +23 -0
  66. package/components/ListLoader/index.controlled.d.ts +5 -5
  67. package/components/ListLoader/index.controlled.js +4 -4
  68. package/components/ListLoader/index.d.ts +11 -11
  69. package/components/ListLoader/index.js +12 -12
  70. package/components/Overlayer/index.d.ts +4 -4
  71. package/components/Overlayer/index.js +6 -6
  72. package/components/Paginator/index.d.ts +7 -12
  73. package/components/Paginator/index.js +7 -11
  74. package/components/ResizeObserver/index.d.ts +14 -3
  75. package/components/ResizeObserver/index.js +49 -24
  76. package/components/Scrllgngn/index.d.ts +17 -13
  77. package/components/Scrllgngn/index.js +25 -84
  78. package/components/Scrllgngn/utils.d.ts +52 -0
  79. package/components/Scrllgngn/utils.js +102 -0
  80. package/components/ScrollListener/index.d.ts +43 -28
  81. package/components/ScrollListener/index.js +59 -79
  82. package/components/ScrollListener/utils.d.ts +37 -16
  83. package/components/ScrollListener/utils.js +141 -28
  84. package/components/Select/index.d.ts +24 -20
  85. package/components/Select/index.js +30 -20
  86. package/components/Sequencer/index.controlled.d.ts +16 -26
  87. package/components/Sequencer/index.controlled.js +15 -12
  88. package/components/Sequencer/index.d.ts +25 -30
  89. package/components/Sequencer/index.js +20 -34
  90. package/components/Subtitles/index.d.ts +29 -5
  91. package/components/Subtitles/index.js +90 -12
  92. package/components/Textarea/index.d.ts +26 -20
  93. package/components/Textarea/index.js +40 -21
  94. package/components/Theatre/index.d.ts +35 -39
  95. package/components/Theatre/index.js +46 -58
  96. package/components/UIModule/index.d.ts +25 -29
  97. package/components/UIModule/index.js +81 -110
  98. package/components/Video/index.controlled.d.ts +51 -51
  99. package/components/Video/index.controlled.js +75 -72
  100. package/components/Video/index.d.ts +12 -14
  101. package/components/Video/index.js +41 -86
  102. package/components/Video/utils.d.ts +35 -3
  103. package/components/Video/utils.js +37 -14
  104. package/components/index.d.ts +6 -6
  105. package/components/index.js +6 -6
  106. package/components/utils/index.d.ts +22 -0
  107. package/components/utils/index.js +31 -0
  108. package/index.d.ts +1 -1
  109. package/index.js +1 -1
  110. package/node/@aws-s3/storage/directory/index.d.ts +2 -2
  111. package/node/@aws-s3/storage/directory/index.js +2 -2
  112. package/node/@aws-s3/storage/file/index.d.ts +1 -1
  113. package/node/@aws-s3/storage/file/index.js +1 -1
  114. package/node/@aws-s3/storage/index.d.ts +1 -1
  115. package/node/@aws-s3/storage/index.js +1 -1
  116. package/node/@google-cloud/storage/directory/index.d.ts +2 -2
  117. package/node/@google-cloud/storage/directory/index.js +2 -2
  118. package/node/@google-cloud/storage/file/index.d.ts +2 -2
  119. package/node/@google-cloud/storage/file/index.js +2 -2
  120. package/node/@google-cloud/storage/index.d.ts +1 -1
  121. package/node/@google-cloud/storage/index.js +1 -1
  122. package/node/cloud-storage/operations/index.d.ts +2 -2
  123. package/node/cloud-storage/operations/index.js +2 -2
  124. package/node/ftps/file/index.d.ts +2 -2
  125. package/node/ftps/file/index.js +2 -2
  126. package/node/images/index.d.ts +1 -1
  127. package/node/images/index.js +1 -1
  128. package/node/images/transform/operations/index.d.ts +2 -2
  129. package/node/images/transform/operations/index.js +2 -2
  130. package/node/index.d.ts +1 -1
  131. package/node/index.js +1 -1
  132. package/node/process/index.d.ts +1 -1
  133. package/node/process/index.js +1 -1
  134. package/node/sftp/file/index.d.ts +2 -2
  135. package/node/sftp/file/index.js +2 -2
  136. package/node/sftp/index.d.ts +1 -1
  137. package/node/sftp/index.js +1 -1
  138. package/package.json +20 -5
  139. package/TODO.md +0 -269
  140. package/components/BeforeAfter/utils.d.ts +0 -4
  141. package/components/BeforeAfter/utils.js +0 -9
  142. package/components/Input/index.controlled.d.ts +0 -42
  143. package/components/Input/index.controlled.js +0 -54
  144. package/components/Select/index.controlled.d.ts +0 -43
  145. package/components/Select/index.controlled.js +0 -54
  146. package/components/Subtitles/types.d.ts +0 -24
  147. package/components/Subtitles/utils.d.ts +0 -32
  148. package/components/Subtitles/utils.js +0 -107
  149. package/components/Textarea/index.controlled.d.ts +0 -50
  150. package/components/Textarea/index.controlled.js +0 -75
  151. /package/{components/Subtitles/types.js → agnostic/time/dates/format-date/index.test.d.ts} +0 -0
  152. /package/components/ResizeObserver/{style.module.css → styles.module.css} +0 -0
@@ -1,50 +0,0 @@
1
- import { type FunctionComponent, type TextareaHTMLAttributes, type ReactNode } from 'react';
2
- import type { WithClassName } from '../utils/types.js';
3
- /**
4
- * Props for the {@link ControlledTextarea} component.
5
- *
6
- * Extends all native {@link TextareaHTMLAttributes} and {@link WithClassName}
7
- * with optional label, error content, and automatic height adjustment.
8
- *
9
- * @property label - Content rendered as an associated `<label>`. When omitted, no label is rendered.
10
- * @property error - Content rendered as an error message below the textarea. When omitted, no error is rendered.
11
- * @property autoHeight - When `true`, automatically adjusts the textarea height
12
- * to fit its content. Defaults to `false`.
13
- * @property className - Additional class name(s) applied to the textarea element.
14
- */
15
- export type Props = TextareaHTMLAttributes<HTMLTextAreaElement> & WithClassName<{
16
- label?: ReactNode;
17
- error?: ReactNode;
18
- autoHeight?: boolean;
19
- }>;
20
- /**
21
- * Controlled textarea field component.
22
- *
23
- * Renders a native `<textarea>` element with optional label and error feedback.
24
- * The textarea value is entirely driven by the provided `value` prop and all
25
- * native textarea attributes are forwarded to the underlying element.
26
- *
27
- * A stable auto-generated `id` is created on mount and used to associate the
28
- * rendered label through the `htmlFor` attribute.
29
- *
30
- * When `autoHeight` is enabled, the textarea height automatically expands or
31
- * shrinks to match its content.
32
- *
33
- * ### CSS elements
34
- * - `label`
35
- * - `error`
36
- *
37
- * @param props - Component properties.
38
- * @see {@link Props}
39
- *
40
- * @returns A labelled controlled textarea with optional error feedback.
41
- *
42
- * @remarks
43
- * - The component does not manage its own value state.
44
- * - Consumers are responsible for updating `value` in response to `onChange`.
45
- * - Additional `className` values are merged with the component public class name
46
- * and applied to the underlying `<textarea>` element.
47
- * - When `autoHeight` is enabled, height recalculation occurs whenever the
48
- * textarea value changes and every 500ms thereafter.
49
- */
50
- export declare const ControlledTextarea: FunctionComponent<Props>;
@@ -1,75 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState, useLayoutEffect, useRef } from 'react';
3
- import { clss } from '../../agnostic/css/clss/index.js';
4
- import { isNotFalsy } from '../../agnostic/booleans/is-falsy/index.js';
5
- import { randomHash } from '../../agnostic/random/uuid/index.js';
6
- import { textarea as publicClassName } from '../public-classnames.js';
7
- import { mergeClassNames } from '../utils/index.js';
8
- import cssModule from './styles.module.css';
9
- /**
10
- * Controlled textarea field component.
11
- *
12
- * Renders a native `<textarea>` element with optional label and error feedback.
13
- * The textarea value is entirely driven by the provided `value` prop and all
14
- * native textarea attributes are forwarded to the underlying element.
15
- *
16
- * A stable auto-generated `id` is created on mount and used to associate the
17
- * rendered label through the `htmlFor` attribute.
18
- *
19
- * When `autoHeight` is enabled, the textarea height automatically expands or
20
- * shrinks to match its content.
21
- *
22
- * ### CSS elements
23
- * - `label`
24
- * - `error`
25
- *
26
- * @param props - Component properties.
27
- * @see {@link Props}
28
- *
29
- * @returns A labelled controlled textarea with optional error feedback.
30
- *
31
- * @remarks
32
- * - The component does not manage its own value state.
33
- * - Consumers are responsible for updating `value` in response to `onChange`.
34
- * - Additional `className` values are merged with the component public class name
35
- * and applied to the underlying `<textarea>` element.
36
- * - When `autoHeight` is enabled, height recalculation occurs whenever the
37
- * textarea value changes and every 500ms thereafter.
38
- */
39
- export const ControlledTextarea = ({ label, error, autoHeight = false, value, className, ...rest }) => {
40
- const [id] = useState(`_${randomHash(12)}`);
41
- const textareaRef = useRef(null);
42
- // Handlers
43
- const adjustHeight = () => {
44
- const textarea = textareaRef.current;
45
- if (textarea === null)
46
- return;
47
- textarea.style.height = 'auto';
48
- textarea.style.height = `${textarea.scrollHeight}px`;
49
- };
50
- // Fx. dep `authHeight`, `value` - Compute content height
51
- useLayoutEffect(() => {
52
- if (!autoHeight)
53
- return;
54
- adjustHeight();
55
- }, [autoHeight, value]);
56
- // Rendering
57
- const c = clss(publicClassName, { cssModule });
58
- const rootClss = mergeClassNames(c(null), className);
59
- return _jsxs(_Fragment, { children: [isNotFalsy(label) && _jsx("label", { className: c('label'), htmlFor: id, children: label }), _jsx("textarea", { ...rest, ref: textareaRef, className: rootClss, id: id, value: value, onChange: e => {
60
- const { target } = e;
61
- rest.onChange?.(e);
62
- if (value === undefined)
63
- return;
64
- if (typeof value === 'number') {
65
- target.value = `${value}`;
66
- }
67
- else if (typeof value === 'string') {
68
- target.value = value;
69
- }
70
- else {
71
- // value is readonly string[]
72
- // not supported for <select>; ignore or normalize if needed
73
- }
74
- } }), isNotFalsy(error) && _jsx("span", { className: c('error'), children: error })] });
75
- };