@design-edito/tools 0.4.22 → 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 (61) hide show
  1. package/agnostic/colors/index.d.ts +4 -4
  2. package/agnostic/colors/index.js +4 -4
  3. package/agnostic/css/index.d.ts +2 -2
  4. package/agnostic/css/index.js +2 -2
  5. package/agnostic/html/hyper-json/smart-tags/coalesced/index.d.ts +11 -11
  6. package/agnostic/html/hyper-json/smart-tags/coalesced/index.js +11 -11
  7. package/agnostic/html/hyper-json/smart-tags/isolated/index.d.ts +2 -2
  8. package/agnostic/html/hyper-json/smart-tags/isolated/index.js +2 -2
  9. package/agnostic/html/index.d.ts +3 -3
  10. package/agnostic/html/index.js +3 -3
  11. package/agnostic/misc/index.d.ts +5 -5
  12. package/agnostic/misc/index.js +5 -5
  13. package/agnostic/numbers/index.d.ts +1 -1
  14. package/agnostic/numbers/index.js +1 -1
  15. package/agnostic/objects/index.d.ts +3 -3
  16. package/agnostic/objects/index.js +3 -3
  17. package/agnostic/sanitization/index.d.ts +1 -1
  18. package/agnostic/sanitization/index.js +1 -1
  19. package/agnostic/strings/index.d.ts +2 -2
  20. package/agnostic/strings/index.js +2 -2
  21. package/agnostic/time/index.d.ts +2 -2
  22. package/agnostic/time/index.js +2 -2
  23. package/components/Button/index.d.ts +2 -7
  24. package/components/Button/index.js +2 -2
  25. package/components/Iframe/index.d.ts +16 -34
  26. package/components/Iframe/index.js +67 -27
  27. package/components/Input/index.controlled.d.ts +42 -0
  28. package/components/Input/index.controlled.js +53 -0
  29. package/components/Input/index.d.ts +21 -17
  30. package/components/Input/index.js +27 -18
  31. package/components/Select/index.controlled.d.ts +43 -0
  32. package/components/Select/index.controlled.js +53 -0
  33. package/components/Select/index.d.ts +22 -18
  34. package/components/Select/index.js +27 -18
  35. package/components/Textarea/index.controlled.d.ts +50 -0
  36. package/components/Textarea/index.controlled.js +74 -0
  37. package/components/Textarea/index.d.ts +22 -17
  38. package/components/Textarea/index.js +27 -18
  39. package/components/index.d.ts +1 -1
  40. package/components/index.js +1 -1
  41. package/node/@aws-s3/storage/directory/index.d.ts +1 -1
  42. package/node/@aws-s3/storage/directory/index.js +1 -1
  43. package/node/@aws-s3/storage/file/index.d.ts +1 -1
  44. package/node/@aws-s3/storage/file/index.js +1 -1
  45. package/node/@google-cloud/storage/directory/index.d.ts +1 -1
  46. package/node/@google-cloud/storage/directory/index.js +1 -1
  47. package/node/@google-cloud/storage/file/index.d.ts +2 -2
  48. package/node/@google-cloud/storage/file/index.js +2 -2
  49. package/node/@google-cloud/storage/index.d.ts +1 -1
  50. package/node/@google-cloud/storage/index.js +1 -1
  51. package/node/cloud-storage/operations/index.d.ts +1 -1
  52. package/node/cloud-storage/operations/index.js +1 -1
  53. package/node/images/transform/operations/index.d.ts +1 -1
  54. package/node/images/transform/operations/index.js +1 -1
  55. package/node/index.d.ts +1 -1
  56. package/node/index.js +1 -1
  57. package/node/process/index.d.ts +1 -1
  58. package/node/process/index.js +1 -1
  59. package/node/sftp/file/index.d.ts +1 -1
  60. package/node/sftp/file/index.js +1 -1
  61. package/package.json +1 -1
@@ -1,30 +1,39 @@
1
- import { jsx as _jsx, Fragment as _Fragment, 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(_Fragment, { children: [isNotFalsy(label) && _jsx("label", { className: c('label'), htmlFor: id, children: label }), _jsx("textarea", { ...rest, className: rootClss, 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'
@@ -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'
@@ -1,6 +1,6 @@
1
1
  export * as copy from './copy/index.js'
2
- export * as exists from './exists/index.js'
3
2
  export * as download from './download/index.js'
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'
6
6
  export * as stat from './stat/index.js'
@@ -1,6 +1,6 @@
1
1
  export * as copy from './copy/index.js'
2
- export * as exists from './exists/index.js'
3
2
  export * as download from './download/index.js'
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'
6
6
  export * as stat from './stat/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'
@@ -1,6 +1,6 @@
1
- export * as download from './download/index.js'
2
- export * as exists from './exists/index.js'
3
1
  export * as copy from './copy/index.js'
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
- export * as download from './download/index.js'
2
- export * as exists from './exists/index.js'
3
1
  export * as copy from './copy/index.js'
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,3 +1,3 @@
1
1
  export * as bucket from './bucket/index.js'
2
- export * as file from './file/index.js'
3
2
  export * as directory from './directory/index.js'
3
+ export * as file from './file/index.js'
@@ -1,3 +1,3 @@
1
1
  export * as bucket from './bucket/index.js'
2
- export * as file from './file/index.js'
3
2
  export * as directory from './directory/index.js'
3
+ export * as file from './file/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'
@@ -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'
13
+ export * as overlay from './overlay/index.js'
14
14
  export * as rotate from './rotate/index.js'
15
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'
13
+ export * as overlay from './overlay/index.js'
14
14
  export * as rotate from './rotate/index.js'
15
15
  export * as saturate from './saturate/index.js'
package/node/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export * as designEdito from './@design-edito/index.js'
2
1
  export * as awsS3 from './@aws-s3/index.js'
2
+ export * as designEdito from './@design-edito/index.js'
3
3
  export * as express from './@express/index.js'
4
4
  export * as googleCloud from './@google-cloud/index.js'
5
5
  export * as cloudStorage from './cloud-storage/index.js'
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
- export * as designEdito from './@design-edito/index.js'
2
1
  export * as awsS3 from './@aws-s3/index.js'
2
+ export * as designEdito from './@design-edito/index.js'
3
3
  export * as express from './@express/index.js'
4
4
  export * as googleCloud from './@google-cloud/index.js'
5
5
  export * as cloudStorage from './cloud-storage/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.22",
3
+ "version": "0.4.23",
4
4
  "description": "",
5
5
  "author": "Maxime Fabas",
6
6
  "license": "ISC",