@design-edito/tools 0.4.21 → 0.4.23

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 (59) hide show
  1. package/agnostic/colors/index.d.ts +3 -3
  2. package/agnostic/colors/index.js +3 -3
  3. package/agnostic/css/index.d.ts +1 -1
  4. package/agnostic/css/index.js +1 -1
  5. package/agnostic/html/hyper-json/smart-tags/coalesced/index.d.ts +14 -14
  6. package/agnostic/html/hyper-json/smart-tags/coalesced/index.js +14 -14
  7. package/agnostic/html/hyper-json/smart-tags/isolated/index.d.ts +3 -3
  8. package/agnostic/html/hyper-json/smart-tags/isolated/index.js +3 -3
  9. package/agnostic/html/index.d.ts +4 -4
  10. package/agnostic/html/index.js +4 -4
  11. package/agnostic/index.d.ts +1 -1
  12. package/agnostic/index.js +1 -1
  13. package/agnostic/misc/index.d.ts +2 -2
  14. package/agnostic/misc/index.js +2 -2
  15. package/agnostic/numbers/index.d.ts +1 -1
  16. package/agnostic/numbers/index.js +1 -1
  17. package/agnostic/objects/index.d.ts +2 -2
  18. package/agnostic/objects/index.js +2 -2
  19. package/agnostic/sanitization/index.d.ts +1 -1
  20. package/agnostic/sanitization/index.js +1 -1
  21. package/agnostic/strings/index.d.ts +1 -1
  22. package/agnostic/strings/index.js +1 -1
  23. package/agnostic/time/index.d.ts +1 -1
  24. package/agnostic/time/index.js +1 -1
  25. package/components/Button/index.d.ts +2 -7
  26. package/components/Button/index.js +2 -2
  27. package/components/Iframe/index.d.ts +16 -34
  28. package/components/Iframe/index.js +67 -27
  29. package/components/Input/index.controlled.d.ts +42 -0
  30. package/components/Input/index.controlled.js +53 -0
  31. package/components/Input/index.d.ts +21 -17
  32. package/components/Input/index.js +27 -18
  33. package/components/Select/index.controlled.d.ts +43 -0
  34. package/components/Select/index.controlled.js +53 -0
  35. package/components/Select/index.d.ts +22 -18
  36. package/components/Select/index.js +27 -18
  37. package/components/Textarea/index.controlled.d.ts +50 -0
  38. package/components/Textarea/index.controlled.js +74 -0
  39. package/components/Textarea/index.d.ts +22 -17
  40. package/components/Textarea/index.js +27 -18
  41. package/components/index.d.ts +1 -1
  42. package/components/index.js +1 -1
  43. package/index.d.ts +1 -1
  44. package/index.js +1 -1
  45. package/node/@google-cloud/storage/file/index.d.ts +1 -1
  46. package/node/@google-cloud/storage/file/index.js +1 -1
  47. package/node/cloud-storage/operations/index.d.ts +1 -1
  48. package/node/cloud-storage/operations/index.js +1 -1
  49. package/node/ftps/directory/index.d.ts +1 -1
  50. package/node/ftps/directory/index.js +1 -1
  51. package/node/images/transform/operations/index.d.ts +2 -2
  52. package/node/images/transform/operations/index.js +2 -2
  53. package/node/index.d.ts +1 -1
  54. package/node/index.js +1 -1
  55. package/node/process/index.d.ts +1 -1
  56. package/node/process/index.js +1 -1
  57. package/node/sftp/file/index.d.ts +1 -1
  58. package/node/sftp/file/index.js +1 -1
  59. package/package.json +1 -1
@@ -1,30 +1,39 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useState } 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';
3
+ import { ControlledTextarea } from './index.controlled.js';
9
4
  /**
10
- * Textarea field component with optional label and error message.
5
+ * Textarea field component supporting controlled and hybrid usage.
11
6
  *
12
- * Renders a native `<textarea>` element inside a wrapper, with a stable
13
- * auto-generated `id` used to associate the label via `htmlFor`.
14
- * All standard textarea attributes are forwarded to the underlying element.
7
+ * Wraps {@link ControlledTextarea} and automatically manages the textarea
8
+ * value when no `value` prop is provided.
15
9
  *
16
10
  * ### CSS elements
17
11
  * - `label`
18
- * - `textarea`
19
12
  * - `error`
20
13
  *
21
14
  * @param props - Component properties.
22
15
  * @see {@link Props}
23
- * @returns A labelled textarea wrapper with optional error feedback.
16
+ *
17
+ * @returns A labelled textarea with optional internal value management.
18
+ *
19
+ * @remarks
20
+ * - In controlled mode (`value` defined), the textarea value is fully driven
21
+ * by the parent component and internal state is never updated.
22
+ * - In hybrid mode, internal state is initialized from `defaultValue` and
23
+ * subsequently manages value updates itself.
24
+ * - In hybrid mode, the internal value is updated before forwarding the
25
+ * `onChange` callback.
26
+ * - `defaultValue` is only used to initialize internal state and is not
27
+ * forwarded to the underlying controlled component.
24
28
  */
25
- export const Textarea = ({ label, error, className, ...rest }) => {
26
- const [id] = useState(`_${randomHash(12)}`);
27
- const c = clss(publicClassName, { cssModule });
28
- const rootClss = mergeClassNames(c(null), className);
29
- return _jsxs("span", { className: rootClss, children: [isNotFalsy(label) && _jsx("label", { className: c('label'), htmlFor: id, children: label }), _jsx("textarea", { ...rest, className: c('textarea'), id: id }), isNotFalsy(error) && _jsx("span", { className: c('error'), children: error })] });
29
+ export const Textarea = ({ defaultValue, value, onChange, ...rest }) => {
30
+ const isControlled = value !== undefined;
31
+ const [internal, setInternal] = useState(defaultValue ?? '');
32
+ const currentValue = isControlled ? value : internal;
33
+ const handleChange = (e) => {
34
+ if (!isControlled)
35
+ setInternal(e.target.value);
36
+ onChange?.(e);
37
+ };
38
+ return _jsx(ControlledTextarea, { ...rest, value: currentValue, onChange: handleChange });
30
39
  };
@@ -20,8 +20,8 @@ export * as sequencer from './Sequencer/index.js'
20
20
  export * as shadowRoot from './ShadowRoot/index.js'
21
21
  export * as subtitles from './Subtitles/index.js'
22
22
  export * as textarea from './Textarea/index.js'
23
- export * as theatre from './Theatre/index.js'
24
23
  export * as uiModule from './UIModule/index.js'
24
+ export * as theatre from './Theatre/index.js'
25
25
  export * as video from './Video/index.js'
26
26
  export * as wipAudioQuote from './_WIP_AudioQuote/index.js'
27
27
  export * as wipIcon from './_WIP_Icon/index.js'
@@ -20,8 +20,8 @@ export * as sequencer from './Sequencer/index.js'
20
20
  export * as shadowRoot from './ShadowRoot/index.js'
21
21
  export * as subtitles from './Subtitles/index.js'
22
22
  export * as textarea from './Textarea/index.js'
23
- export * as theatre from './Theatre/index.js'
24
23
  export * as uiModule from './UIModule/index.js'
24
+ export * as theatre from './Theatre/index.js'
25
25
  export * as video from './Video/index.js'
26
26
  export * as wipAudioQuote from './_WIP_AudioQuote/index.js'
27
27
  export * as wipIcon from './_WIP_Icon/index.js'
package/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * as components from './components/index.js'
2
1
  export * as agnostic from './agnostic/index.js'
2
+ export * as components from './components/index.js'
3
3
  export * as node from './node/index.js'
package/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export * as components from './components/index.js'
2
1
  export * as agnostic from './agnostic/index.js'
2
+ export * as components from './components/index.js'
3
3
  export * as node from './node/index.js'
@@ -1,6 +1,6 @@
1
1
  export * as copy from './copy/index.js'
2
- export * as download from './download/index.js'
3
2
  export * as exists from './exists/index.js'
3
+ export * as download from './download/index.js'
4
4
  export * as generateSignedUrl from './generate-signed-url/index.js'
5
5
  export * as getMetadata from './get-metadata/index.js'
6
6
  export * as getPermissions from './get-permissions/index.js'
@@ -1,6 +1,6 @@
1
1
  export * as copy from './copy/index.js'
2
- export * as download from './download/index.js'
3
2
  export * as exists from './exists/index.js'
3
+ export * as download from './download/index.js'
4
4
  export * as generateSignedUrl from './generate-signed-url/index.js'
5
5
  export * as getMetadata from './get-metadata/index.js'
6
6
  export * as getPermissions from './get-permissions/index.js'
@@ -1,5 +1,5 @@
1
- export * as copyFile from './copy-file/index.js'
2
1
  export * as copyDir from './copy-dir/index.js'
2
+ export * as copyFile from './copy-file/index.js'
3
3
  export * as downloadFile from './download-file/index.js'
4
4
  export * as existsFile from './exists-file/index.js'
5
5
  export * as listDir from './list-dir/index.js'
@@ -1,5 +1,5 @@
1
- export * as copyFile from './copy-file/index.js'
2
1
  export * as copyDir from './copy-dir/index.js'
2
+ export * as copyFile from './copy-file/index.js'
3
3
  export * as downloadFile from './download-file/index.js'
4
4
  export * as existsFile from './exists-file/index.js'
5
5
  export * as listDir from './list-dir/index.js'
@@ -1,4 +1,4 @@
1
1
  export * as copyDir from './copy-dir/index.js'
2
- export * as moveDir from './move-dir/index.js'
3
2
  export * as list from './list/index.js'
3
+ export * as moveDir from './move-dir/index.js'
4
4
  export * as removeDir from './remove-dir/index.js'
@@ -1,4 +1,4 @@
1
1
  export * as copyDir from './copy-dir/index.js'
2
- export * as moveDir from './move-dir/index.js'
3
2
  export * as list from './list/index.js'
3
+ export * as moveDir from './move-dir/index.js'
4
4
  export * as removeDir from './remove-dir/index.js'
@@ -9,7 +9,7 @@ export * as hue from './hue/index.js'
9
9
  export * as level from './level/index.js'
10
10
  export * as lighten from './lighten/index.js'
11
11
  export * as normalize from './normalize/index.js'
12
- export * as overlay from './overlay/index.js'
13
12
  export * as resize from './resize/index.js'
14
- export * as saturate from './saturate/index.js'
13
+ export * as overlay from './overlay/index.js'
15
14
  export * as rotate from './rotate/index.js'
15
+ export * as saturate from './saturate/index.js'
@@ -9,7 +9,7 @@ export * as hue from './hue/index.js'
9
9
  export * as level from './level/index.js'
10
10
  export * as lighten from './lighten/index.js'
11
11
  export * as normalize from './normalize/index.js'
12
- export * as overlay from './overlay/index.js'
13
12
  export * as resize from './resize/index.js'
14
- export * as saturate from './saturate/index.js'
13
+ export * as overlay from './overlay/index.js'
15
14
  export * as rotate from './rotate/index.js'
15
+ export * as saturate from './saturate/index.js'
package/node/index.d.ts CHANGED
@@ -7,5 +7,5 @@ export * as encryption from './encryption/index.js'
7
7
  export * as files from './files/index.js'
8
8
  export * as ftps from './ftps/index.js'
9
9
  export * as images from './images/index.js'
10
- export * as sftp from './sftp/index.js'
11
10
  export * as process from './process/index.js'
11
+ export * as sftp from './sftp/index.js'
package/node/index.js CHANGED
@@ -7,5 +7,5 @@ export * as encryption from './encryption/index.js'
7
7
  export * as files from './files/index.js'
8
8
  export * as ftps from './ftps/index.js'
9
9
  export * as images from './images/index.js'
10
- export * as sftp from './sftp/index.js'
11
10
  export * as process from './process/index.js'
11
+ export * as sftp from './sftp/index.js'
@@ -1,3 +1,3 @@
1
1
  export * as onExit from './on-exit/index.js'
2
- export * as promptContinue from './prompt-continue/index.js'
3
2
  export * as spawner from './spawner/index.js'
3
+ export * as promptContinue from './prompt-continue/index.js'
@@ -1,3 +1,3 @@
1
1
  export * as onExit from './on-exit/index.js'
2
- export * as promptContinue from './prompt-continue/index.js'
3
2
  export * as spawner from './spawner/index.js'
3
+ export * as promptContinue from './prompt-continue/index.js'
@@ -1,5 +1,5 @@
1
- export * as copy from './copy/index.js'
2
1
  export * as download from './download/index.js'
2
+ export * as copy from './copy/index.js'
3
3
  export * as exists from './exists/index.js'
4
4
  export * as move from './move/index.js'
5
5
  export * as remove from './remove/index.js'
@@ -1,5 +1,5 @@
1
- export * as copy from './copy/index.js'
2
1
  export * as download from './download/index.js'
2
+ export * as copy from './copy/index.js'
3
3
  export * as exists from './exists/index.js'
4
4
  export * as move from './move/index.js'
5
5
  export * as remove from './remove/index.js'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@design-edito/tools",
3
- "version": "0.4.21",
3
+ "version": "0.4.23",
4
4
  "description": "",
5
5
  "author": "Maxime Fabas",
6
6
  "license": "ISC",