@mittwald/flow-react-components 0.2.0-alpha.662 → 0.2.0-alpha.664
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/CHANGELOG.md +12 -0
- package/dist/assets/doc-properties.json +91775 -94076
- package/dist/css/all.css +1 -1
- package/dist/js/_virtual/_.locale.json@16189d7d260d7331b0e0a1936d5c7c52.mjs +12 -0
- package/dist/js/_virtual/_.locale.json@16189d7d260d7331b0e0a1936d5c7c52.mjs.map +1 -0
- package/dist/js/_virtual/_.locale.json@6922640321d6c379322b09cbcf0dcdb3.mjs +8 -0
- package/dist/js/_virtual/_.locale.json@6922640321d6c379322b09cbcf0dcdb3.mjs.map +1 -0
- package/dist/js/components/src/components/TextArea/TextArea.mjs +54 -31
- package/dist/js/components/src/components/TextArea/TextArea.mjs.map +1 -1
- package/dist/js/components/src/components/TextArea/TextArea.module.scss.mjs +3 -3
- package/dist/js/components/src/components/TextField/TextField.mjs +92 -20
- package/dist/js/components/src/components/TextField/TextField.mjs.map +1 -1
- package/dist/js/components/src/components/TextField/TextField.module.scss.mjs +7 -3
- package/dist/js/components/src/components/TextField/TextField.module.scss.mjs.map +1 -1
- package/dist/js/components/src/components/Truncate/Truncate.mjs +14 -0
- package/dist/js/components/src/components/Truncate/Truncate.mjs.map +1 -0
- package/dist/js/components/src/components/Truncate/Truncate.module.scss.mjs +9 -0
- package/dist/js/components/src/components/Truncate/Truncate.module.scss.mjs.map +1 -0
- package/dist/js/default.mjs +1 -0
- package/dist/js/default.mjs.map +1 -1
- package/dist/types/components/TextArea/TextArea.browser.test.d.ts +2 -0
- package/dist/types/components/TextArea/TextArea.browser.test.d.ts.map +1 -0
- package/dist/types/components/TextArea/TextArea.d.ts +4 -2
- package/dist/types/components/TextArea/TextArea.d.ts.map +1 -1
- package/dist/types/components/TextField/TextField.browser.test.d.ts +2 -0
- package/dist/types/components/TextField/TextField.browser.test.d.ts.map +1 -0
- package/dist/types/components/TextField/TextField.d.ts +4 -3
- package/dist/types/components/TextField/TextField.d.ts.map +1 -1
- package/dist/types/components/TextField/stories/Default.stories.d.ts +2 -0
- package/dist/types/components/TextField/stories/Default.stories.d.ts.map +1 -1
- package/dist/types/components/Truncate/Truncate.d.ts +9 -0
- package/dist/types/components/Truncate/Truncate.d.ts.map +1 -0
- package/dist/types/components/Truncate/index.d.ts +4 -0
- package/dist/types/components/Truncate/index.d.ts.map +1 -0
- package/dist/types/components/Truncate/stories/Default.stories.d.ts +9 -0
- package/dist/types/components/Truncate/stories/Default.stories.d.ts.map +1 -0
- package/dist/types/components/Truncate/view.d.ts +8 -0
- package/dist/types/components/Truncate/view.d.ts.map +1 -0
- package/dist/types/components/public.d.ts +1 -0
- package/dist/types/components/public.d.ts.map +1 -1
- package/dist/types/views/TruncateView.d.ts +5 -0
- package/dist/types/views/TruncateView.d.ts.map +1 -0
- package/package.json +4 -4
- package/dist/js/_virtual/_.locale.json@444629885187f8ca5450a1c8b14fb45c.mjs +0 -8
- package/dist/js/_virtual/_.locale.json@444629885187f8ca5450a1c8b14fb45c.mjs.map +0 -1
- package/dist/js/components/src/components/TextFieldBase/TextFieldBase.mjs +0 -51
- package/dist/js/components/src/components/TextFieldBase/TextFieldBase.mjs.map +0 -1
- package/dist/types/components/TextFieldBase/TextFieldBase.browser.test.d.ts +0 -2
- package/dist/types/components/TextFieldBase/TextFieldBase.browser.test.d.ts.map +0 -1
- package/dist/types/components/TextFieldBase/TextFieldBase.d.ts +0 -13
- package/dist/types/components/TextFieldBase/TextFieldBase.d.ts.map +0 -1
- package/dist/types/components/TextFieldBase/index.d.ts +0 -3
- package/dist/types/components/TextFieldBase/index.d.ts.map +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
const locales = {"de-DE": { "textField.characters": (args, formatter) => `${formatter.select({0: () => `${args.count}`, other: () => `${args.count}/${args.maxCount}`}, args.maxCount)} Zeichen`,
|
|
4
|
+
"textField.password.hide": `Passwort verbergen`,
|
|
5
|
+
"textField.password.show": `Passwort anzeigen`,
|
|
6
|
+
},"en-US": { "textField.characters": (args, formatter) => `${formatter.select({0: () => `${args.count}`, other: () => `${args.count}/${args.maxCount}`}, args.maxCount)} characters`,
|
|
7
|
+
"textField.password.hide": `Show password`,
|
|
8
|
+
"textField.password.show": `Hide password`,
|
|
9
|
+
}};
|
|
10
|
+
|
|
11
|
+
export { locales as default };
|
|
12
|
+
//# sourceMappingURL=_.locale.json@16189d7d260d7331b0e0a1936d5c7c52.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_.locale.json@16189d7d260d7331b0e0a1936d5c7c52.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
const locales = {"de-DE": { "textArea.characters": (args, formatter) => `${formatter.select({0: () => `${args.count}`, other: () => `${args.count}/${args.maxCount}`}, args.maxCount)} Zeichen`,
|
|
4
|
+
},"en-US": { "textArea.characters": (args, formatter) => `${formatter.select({0: () => `${args.count}`, other: () => `${args.count}/${args.maxCount}`}, args.maxCount)} characters`,
|
|
5
|
+
}};
|
|
6
|
+
|
|
7
|
+
export { locales as default };
|
|
8
|
+
//# sourceMappingURL=_.locale.json@6922640321d6c379322b09cbcf0dcdb3.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_.locale.json@6922640321d6c379322b09cbcf0dcdb3.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
4
|
import * as Aria from 'react-aria-components';
|
|
5
|
-
import { TextFieldBase } from '../TextFieldBase/TextFieldBase.mjs';
|
|
6
5
|
import styles from './TextArea.module.scss.mjs';
|
|
7
6
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
8
7
|
import { useObjectRef } from '@react-aria/utils';
|
|
@@ -12,6 +11,9 @@ import { PropsContextProvider } from '../../lib/propsContext/components/PropsCon
|
|
|
12
11
|
import clsx from 'clsx';
|
|
13
12
|
import { useState, useEffect } from 'react';
|
|
14
13
|
import { useControlledHostValueProps } from '../../lib/remote/useControlledHostValueProps.mjs';
|
|
14
|
+
import { useLocalizedStringFormatter } from 'react-aria';
|
|
15
|
+
import locales from '../../../../_virtual/_.locale.json@6922640321d6c379322b09cbcf0dcdb3.mjs';
|
|
16
|
+
import { FieldDescription } from '../FieldDescription/FieldDescription.mjs';
|
|
15
17
|
|
|
16
18
|
const TextArea = flowComponent("TextArea", (props) => {
|
|
17
19
|
const {
|
|
@@ -22,19 +24,44 @@ const TextArea = flowComponent("TextArea", (props) => {
|
|
|
22
24
|
ref,
|
|
23
25
|
allowVerticalResize,
|
|
24
26
|
allowHorizontalResize,
|
|
27
|
+
showCharacterCount,
|
|
28
|
+
className,
|
|
25
29
|
...rest
|
|
26
30
|
} = useControlledHostValueProps(props);
|
|
31
|
+
const [charactersCount, setCharactersCount] = useState(
|
|
32
|
+
props.defaultValue?.length ?? props.value?.length ?? 0
|
|
33
|
+
);
|
|
34
|
+
const {
|
|
35
|
+
FieldErrorView,
|
|
36
|
+
FieldErrorCaptureContext,
|
|
37
|
+
fieldPropsContext,
|
|
38
|
+
fieldProps
|
|
39
|
+
} = useFieldComponent(props);
|
|
27
40
|
let { allowResize } = props;
|
|
28
41
|
if (allowVerticalResize) {
|
|
29
42
|
allowResize = "vertical";
|
|
30
43
|
} else if (allowHorizontalResize) {
|
|
31
44
|
allowResize = "horizontal";
|
|
32
45
|
}
|
|
33
|
-
const rootClassName = clsx(
|
|
34
|
-
|
|
46
|
+
const rootClassName = clsx(fieldProps.className, className);
|
|
47
|
+
const inputClassName = clsx(
|
|
48
|
+
styles.input,
|
|
35
49
|
typeof allowResize === "boolean" && allowResize ? styles.resize : null,
|
|
36
50
|
allowResize === "horizontal" ? styles.horizontalResize : allowResize === "vertical" ? styles.verticalResize : null
|
|
37
51
|
);
|
|
52
|
+
const handleChange = (v) => {
|
|
53
|
+
if (showCharacterCount) {
|
|
54
|
+
setCharactersCount(v.length);
|
|
55
|
+
}
|
|
56
|
+
if (props.onChange) {
|
|
57
|
+
props.onChange(v);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const translation = useLocalizedStringFormatter(locales);
|
|
61
|
+
const charactersCountDescription = translation.format("textArea.characters", {
|
|
62
|
+
count: charactersCount,
|
|
63
|
+
maxCount: props.maxLength ?? 0
|
|
64
|
+
});
|
|
38
65
|
const localRef = useObjectRef(ref);
|
|
39
66
|
const getHeight = (rows2) => {
|
|
40
67
|
return `calc(var(--line-height--m) * ${rows2} + (var(--form-control--padding-y) * 2))`;
|
|
@@ -77,37 +104,33 @@ const TextArea = flowComponent("TextArea", (props) => {
|
|
|
77
104
|
localRef.current.style.height = scrollHeight + 2 + "px";
|
|
78
105
|
}
|
|
79
106
|
};
|
|
80
|
-
const input = /* @__PURE__ */ jsx(
|
|
81
|
-
Aria.TextArea,
|
|
82
|
-
{
|
|
83
|
-
rows,
|
|
84
|
-
"aria-hidden": props["aria-hidden"],
|
|
85
|
-
placeholder,
|
|
86
|
-
className: rootClassName,
|
|
87
|
-
ref: localRef,
|
|
88
|
-
onChange: updateHeight,
|
|
89
|
-
style: {
|
|
90
|
-
minHeight: getHeight(rows),
|
|
91
|
-
maxHeight: verticallyResizable ? void 0 : getHeight(autoResizeMaxRows)
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
);
|
|
95
|
-
const {
|
|
96
|
-
FieldErrorView,
|
|
97
|
-
FieldErrorCaptureContext,
|
|
98
|
-
fieldPropsContext,
|
|
99
|
-
fieldProps
|
|
100
|
-
} = useFieldComponent(props);
|
|
101
107
|
return /* @__PURE__ */ jsx(
|
|
102
|
-
|
|
108
|
+
Aria.TextField,
|
|
103
109
|
{
|
|
104
110
|
...rest,
|
|
105
111
|
...fieldProps,
|
|
106
|
-
className:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
112
|
+
className: rootClassName,
|
|
113
|
+
onChange: handleChange,
|
|
114
|
+
children: /* @__PURE__ */ jsxs(PropsContextProvider, { props: fieldPropsContext, children: [
|
|
115
|
+
/* @__PURE__ */ jsx(FieldErrorCaptureContext, { children }),
|
|
116
|
+
/* @__PURE__ */ jsx(
|
|
117
|
+
Aria.TextArea,
|
|
118
|
+
{
|
|
119
|
+
rows,
|
|
120
|
+
"aria-hidden": props["aria-hidden"],
|
|
121
|
+
placeholder,
|
|
122
|
+
className: inputClassName,
|
|
123
|
+
ref: localRef,
|
|
124
|
+
onChange: updateHeight,
|
|
125
|
+
style: {
|
|
126
|
+
minHeight: getHeight(rows),
|
|
127
|
+
maxHeight: verticallyResizable ? void 0 : getHeight(autoResizeMaxRows)
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
),
|
|
131
|
+
showCharacterCount && /* @__PURE__ */ jsx(FieldDescription, { children: charactersCountDescription }),
|
|
132
|
+
/* @__PURE__ */ jsx(FieldErrorView, {})
|
|
133
|
+
] })
|
|
111
134
|
}
|
|
112
135
|
);
|
|
113
136
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.mjs","sources":["../../../../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["import * as Aria from \"react-aria-components\";\nimport
|
|
1
|
+
{"version":3,"file":"TextArea.mjs","sources":["../../../../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["import * as Aria from \"react-aria-components\";\nimport styles from \"./TextArea.module.scss\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport { type PropsWithChildren, useEffect, useState } from \"react\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"./locales/*.locale.json\";\nimport { FieldDescription } from \"@/components/FieldDescription\";\n\nexport interface TextAreaProps\n extends\n PropsWithChildren<Omit<Aria.TextFieldProps, \"children\">>,\n Pick<Aria.TextAreaProps, \"placeholder\" | \"rows\" | \"aria-hidden\">,\n FlowComponentProps<HTMLTextAreaElement> {\n /** Whether a character count should be displayed inside the field description. */\n showCharacterCount?: boolean;\n /**\n * Whether the text area should grow if its content gets longer than its\n * initial height.\n */\n autoResizeMaxRows?: number;\n /** Allows the user to manually resize the textArea horizontally. */\n allowResize?: boolean | \"horizontal\" | \"vertical\";\n /** @deprecated Use `allowResize` instead. */\n allowHorizontalResize?: boolean;\n /** @deprecated Use `allowResize` instead. */\n allowVerticalResize?: boolean;\n}\n\n/** @flr-generate all */\nexport const TextArea = flowComponent(\"TextArea\", (props) => {\n const {\n children,\n placeholder,\n rows = 5,\n autoResizeMaxRows = rows,\n ref,\n allowVerticalResize,\n allowHorizontalResize,\n showCharacterCount,\n className,\n ...rest\n } = useControlledHostValueProps(props);\n\n const [charactersCount, setCharactersCount] = useState(\n props.defaultValue?.length ?? props.value?.length ?? 0,\n );\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n fieldProps,\n } = useFieldComponent(props);\n\n let { allowResize } = props;\n if (allowVerticalResize) {\n allowResize = \"vertical\";\n } else if (allowHorizontalResize) {\n allowResize = \"horizontal\";\n }\n\n const rootClassName = clsx(fieldProps.className, className);\n\n const inputClassName = clsx(\n styles.input,\n typeof allowResize === \"boolean\" && allowResize ? styles.resize : null,\n allowResize === \"horizontal\"\n ? styles.horizontalResize\n : allowResize === \"vertical\"\n ? styles.verticalResize\n : null,\n );\n\n const handleChange = (v: string) => {\n if (showCharacterCount) {\n setCharactersCount(v.length);\n }\n if (props.onChange) {\n props.onChange(v);\n }\n };\n\n const translation = useLocalizedStringFormatter(locales);\n\n const charactersCountDescription = translation.format(\"textArea.characters\", {\n count: charactersCount,\n maxCount: props.maxLength ?? 0,\n });\n\n const localRef = useObjectRef(ref);\n\n const getHeight = (rows: number) => {\n return `calc(var(--line-height--m) * ${rows} + (var(--form-control--padding-y) * 2))`;\n };\n\n const [resized, setResized] = useState(false);\n\n const autoResizable = rows !== autoResizeMaxRows;\n\n const verticallyResizable =\n allowResize && (!autoResizable || (autoResizable && resized));\n\n useEffect(() => {\n const textarea = localRef.current;\n if (!textarea) return;\n\n const startHeight = textarea.offsetHeight;\n let tracking = false;\n\n const handleMouseDown = () => {\n tracking = true;\n };\n\n const handleMouseMove = () => {\n if (!tracking || resized) return;\n\n const currentHeight = textarea.offsetHeight;\n\n if (currentHeight !== startHeight) {\n setResized(true);\n tracking = false;\n }\n };\n\n const handleMouseUp = () => {\n tracking = false;\n };\n\n window.addEventListener(\"mousedown\", handleMouseDown);\n window.addEventListener(\"mousemove\", handleMouseMove);\n window.addEventListener(\"mouseup\", handleMouseUp);\n\n return () => {\n window.removeEventListener(\"mousedown\", handleMouseDown);\n window.removeEventListener(\"mousemove\", handleMouseMove);\n window.removeEventListener(\"mouseup\", handleMouseUp);\n };\n }, [resized]);\n\n const updateHeight = () => {\n if (localRef.current && autoResizable && !verticallyResizable) {\n // https://stackoverflow.com/a/60795884\n localRef.current.style.height = \"0px\";\n const scrollHeight = localRef.current.scrollHeight;\n // + 2 to add border height\n localRef.current.style.height = scrollHeight + 2 + \"px\";\n }\n };\n\n return (\n <Aria.TextField\n {...rest}\n {...fieldProps}\n className={rootClassName}\n onChange={handleChange}\n >\n <PropsContextProvider props={fieldPropsContext}>\n <FieldErrorCaptureContext>{children}</FieldErrorCaptureContext>\n <Aria.TextArea\n rows={rows}\n aria-hidden={props[\"aria-hidden\"]}\n placeholder={placeholder}\n className={inputClassName}\n ref={localRef}\n onChange={updateHeight}\n style={{\n minHeight: getHeight(rows),\n maxHeight: verticallyResizable\n ? undefined\n : getHeight(autoResizeMaxRows),\n }}\n />\n {showCharacterCount && (\n <FieldDescription>{charactersCountDescription}</FieldDescription>\n )}\n <FieldErrorView />\n </PropsContextProvider>\n </Aria.TextField>\n );\n});\n\nexport default TextArea;\n"],"names":["rows"],"mappings":";;;;;;;;;;;;;;;AAmCO,MAAM,QAAA,GAAW,aAAA,CAAc,UAAA,EAAY,CAAC,KAAA,KAAU;AAC3D,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,WAAA;AAAA,IACA,IAAA,GAAO,CAAA;AAAA,IACP,iBAAA,GAAoB,IAAA;AAAA,IACpB,GAAA;AAAA,IACA,mBAAA;AAAA,IACA,qBAAA;AAAA,IACA,kBAAA;AAAA,IACA,SAAA;AAAA,IACA,GAAG;AAAA,GACL,GAAI,4BAA4B,KAAK,CAAA;AAErC,EAAA,MAAM,CAAC,eAAA,EAAiB,kBAAkB,CAAA,GAAI,QAAA;AAAA,IAC5C,KAAA,CAAM,YAAA,EAAc,MAAA,IAAU,KAAA,CAAM,OAAO,MAAA,IAAU;AAAA,GACvD;AAEA,EAAA,MAAM;AAAA,IACJ,cAAA;AAAA,IACA,wBAAA;AAAA,IACA,iBAAA;AAAA,IACA;AAAA,GACF,GAAI,kBAAkB,KAAK,CAAA;AAE3B,EAAA,IAAI,EAAE,aAAY,GAAI,KAAA;AACtB,EAAA,IAAI,mBAAA,EAAqB;AACvB,IAAA,WAAA,GAAc,UAAA;AAAA,EAChB,WAAW,qBAAA,EAAuB;AAChC,IAAA,WAAA,GAAc,YAAA;AAAA,EAChB;AAEA,EAAA,MAAM,aAAA,GAAgB,IAAA,CAAK,UAAA,CAAW,SAAA,EAAW,SAAS,CAAA;AAE1D,EAAA,MAAM,cAAA,GAAiB,IAAA;AAAA,IACrB,MAAA,CAAO,KAAA;AAAA,IACP,OAAO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,IAAA;AAAA,MACH,GAAG,UAAA;AAAA,MACJ,SAAA,EAAW,aAAA;AAAA,MACX,QAAA,EAAU,YAAA;AAAA,MAEV,QAAA,kBAAA,IAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,iBAAA,EAC3B,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,4BAA0B,QAAA,EAAS,CAAA;AAAA,wBACpC,GAAA;AAAA,UAAC,IAAA,CAAK,QAAA;AAAA,UAAL;AAAA,YACC,IAAA;AAAA,YACA,aAAA,EAAa,MAAM,aAAa,CAAA;AAAA,YAChC,WAAA;AAAA,YACA,SAAA,EAAW,cAAA;AAAA,YACX,GAAA,EAAK,QAAA;AAAA,YACL,QAAA,EAAU,YAAA;AAAA,YACV,KAAA,EAAO;AAAA,cACL,SAAA,EAAW,UAAU,IAAI,CAAA;AAAA,cACzB,SAAA,EAAW,mBAAA,GACP,MAAA,GACA,SAAA,CAAU,iBAAiB;AAAA;AACjC;AAAA,SACF;AAAA,QACC,kBAAA,oBACC,GAAA,CAAC,gBAAA,EAAA,EAAkB,QAAA,EAAA,0BAAA,EAA2B,CAAA;AAAA,4BAE/C,cAAA,EAAA,EAAe;AAAA,OAAA,EAClB;AAAA;AAAA,GACF;AAEJ,CAAC;;;;"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
-
const
|
|
3
|
+
const input = "flow--text-area--input";
|
|
4
4
|
const horizontalResize = "flow--text-area--horizontal-resize";
|
|
5
5
|
const verticalResize = "flow--text-area--vertical-resize";
|
|
6
6
|
const resize = "flow--text-area--resize";
|
|
7
7
|
const styles = {
|
|
8
|
-
|
|
8
|
+
input: input,
|
|
9
9
|
horizontalResize: horizontalResize,
|
|
10
10
|
verticalResize: verticalResize,
|
|
11
11
|
resize: resize
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
export { styles as default, horizontalResize,
|
|
14
|
+
export { styles as default, horizontalResize, input, resize, verticalResize };
|
|
15
15
|
//# sourceMappingURL=TextArea.module.scss.mjs.map
|
|
@@ -1,41 +1,113 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
import * as Aria from 'react-aria-components';
|
|
5
|
-
import { TextFieldBase } from '../TextFieldBase/TextFieldBase.mjs';
|
|
6
|
-
import styles from './TextField.module.scss.mjs';
|
|
3
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
4
|
import { flowComponent } from '../../lib/componentFactory/flowComponent.mjs';
|
|
8
|
-
import
|
|
5
|
+
import * as Aria from 'react-aria-components';
|
|
6
|
+
import { useState } from 'react';
|
|
7
|
+
import { useControlledHostValueProps } from '../../lib/remote/useControlledHostValueProps.mjs';
|
|
9
8
|
import '../../lib/propsContext/propsContext.mjs';
|
|
10
9
|
import { PropsContextProvider } from '../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
11
|
-
import {
|
|
10
|
+
import { useFieldComponent } from '../../lib/hooks/useFieldComponent.mjs';
|
|
11
|
+
import styles from './TextField.module.scss.mjs';
|
|
12
|
+
import { FieldDescription } from '../FieldDescription/FieldDescription.mjs';
|
|
13
|
+
import { useLocalizedStringFormatter } from 'react-aria';
|
|
14
|
+
import locales from '../../../../_virtual/_.locale.json@16189d7d260d7331b0e0a1936d5c7c52.mjs';
|
|
15
|
+
import { Button } from '../Button/Button.mjs';
|
|
16
|
+
import '@tabler/icons-react';
|
|
17
|
+
import '../Icon/Icon.mjs';
|
|
18
|
+
import '../../views/IconView.mjs';
|
|
19
|
+
import { IconHide } from '../Icon/components/icons/IconHide.mjs';
|
|
20
|
+
import { IconShow } from '../Icon/components/icons/IconShow.mjs';
|
|
21
|
+
import clsx from 'clsx';
|
|
22
|
+
import { TunnelProvider, TunnelExit } from '@mittwald/react-tunnel';
|
|
12
23
|
|
|
13
24
|
const TextField = flowComponent("TextField", (props) => {
|
|
14
|
-
const {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
const {
|
|
26
|
+
className,
|
|
27
|
+
showCharacterCount,
|
|
28
|
+
form,
|
|
29
|
+
placeholder,
|
|
30
|
+
ref,
|
|
31
|
+
type: typeFromProps,
|
|
32
|
+
children,
|
|
33
|
+
...rest
|
|
34
|
+
} = useControlledHostValueProps(props);
|
|
35
|
+
const [charactersCount, setCharactersCount] = useState(
|
|
36
|
+
props.defaultValue?.length ?? props.value?.length ?? 0
|
|
23
37
|
);
|
|
38
|
+
const [type, setType] = useState(typeFromProps);
|
|
24
39
|
const {
|
|
25
40
|
FieldErrorView,
|
|
26
41
|
FieldErrorCaptureContext,
|
|
27
42
|
fieldPropsContext,
|
|
28
43
|
fieldProps
|
|
29
44
|
} = useFieldComponent(props);
|
|
45
|
+
const rootClassName = clsx(fieldProps.className, className);
|
|
46
|
+
const propsContext = {
|
|
47
|
+
Button: {
|
|
48
|
+
className: styles.button,
|
|
49
|
+
variant: "plain",
|
|
50
|
+
color: "secondary",
|
|
51
|
+
tunnelId: "button"
|
|
52
|
+
},
|
|
53
|
+
...fieldPropsContext
|
|
54
|
+
};
|
|
55
|
+
const handleChange = (v) => {
|
|
56
|
+
if (showCharacterCount) {
|
|
57
|
+
setCharactersCount(v.length);
|
|
58
|
+
}
|
|
59
|
+
if (props.onChange) {
|
|
60
|
+
props.onChange(v);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const translation = useLocalizedStringFormatter(locales);
|
|
64
|
+
const charactersCountDescription = translation.format(
|
|
65
|
+
"textField.characters",
|
|
66
|
+
{
|
|
67
|
+
count: charactersCount,
|
|
68
|
+
maxCount: props.maxLength ?? 0
|
|
69
|
+
}
|
|
70
|
+
);
|
|
30
71
|
return /* @__PURE__ */ jsx(
|
|
31
|
-
|
|
72
|
+
Aria.TextField,
|
|
32
73
|
{
|
|
33
74
|
...rest,
|
|
34
75
|
...fieldProps,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
children: /* @__PURE__ */ jsx(PropsContextProvider, { props:
|
|
76
|
+
className: rootClassName,
|
|
77
|
+
onChange: handleChange,
|
|
78
|
+
type,
|
|
79
|
+
children: /* @__PURE__ */ jsx(TunnelProvider, { children: /* @__PURE__ */ jsxs(PropsContextProvider, { props: propsContext, children: [
|
|
80
|
+
/* @__PURE__ */ jsxs(FieldErrorCaptureContext, { children: [
|
|
81
|
+
children,
|
|
82
|
+
/* @__PURE__ */ jsxs("div", { className: styles.inputContainer, children: [
|
|
83
|
+
/* @__PURE__ */ jsx(
|
|
84
|
+
Aria.Input,
|
|
85
|
+
{
|
|
86
|
+
form,
|
|
87
|
+
placeholder,
|
|
88
|
+
className: styles.input,
|
|
89
|
+
ref
|
|
90
|
+
}
|
|
91
|
+
),
|
|
92
|
+
/* @__PURE__ */ jsx(TunnelExit, { id: "button" }),
|
|
93
|
+
typeFromProps === "password" && /* @__PURE__ */ jsx(
|
|
94
|
+
Button,
|
|
95
|
+
{
|
|
96
|
+
color: "secondary",
|
|
97
|
+
variant: "plain",
|
|
98
|
+
className: styles.button,
|
|
99
|
+
onPress: () => setType(type === "password" ? "text" : "password"),
|
|
100
|
+
"aria-label": translation.format(
|
|
101
|
+
`textField.password.${type === "password" ? "show" : "hide"}`
|
|
102
|
+
),
|
|
103
|
+
children: type === "password" ? /* @__PURE__ */ jsx(IconShow, {}) : /* @__PURE__ */ jsx(IconHide, {})
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
] }),
|
|
107
|
+
showCharacterCount && /* @__PURE__ */ jsx(FieldDescription, { children: charactersCountDescription })
|
|
108
|
+
] }),
|
|
109
|
+
/* @__PURE__ */ jsx(FieldErrorView, {})
|
|
110
|
+
] }) })
|
|
39
111
|
}
|
|
40
112
|
);
|
|
41
113
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.mjs","sources":["../../../../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"TextField.mjs","sources":["../../../../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport * as Aria from \"react-aria-components\";\nimport { type PropsWithChildren, useState } from \"react\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport styles from \"./TextField.module.scss\";\nimport { FieldDescription } from \"@/components/FieldDescription\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"./locales/*.locale.json\";\nimport { Button } from \"@/components/Button\";\nimport { IconHide, IconShow } from \"@/components/Icon/components/icons\";\nimport clsx from \"clsx\";\nimport { TunnelExit, TunnelProvider } from \"@mittwald/react-tunnel\";\n\nexport interface TextFieldProps\n extends\n PropsWithChildren<Omit<Aria.TextFieldProps, \"children\">>,\n Pick<Aria.InputProps, \"placeholder\">,\n FlowComponentProps<HTMLInputElement> {\n /** Whether a character count should be displayed inside the field description. */\n showCharacterCount?: boolean;\n}\n\n/** @flr-generate all */\nexport const TextField = flowComponent(\"TextField\", (props) => {\n const {\n className,\n showCharacterCount,\n form,\n placeholder,\n ref,\n type: typeFromProps,\n children,\n ...rest\n } = useControlledHostValueProps(props);\n\n const [charactersCount, setCharactersCount] = useState(\n props.defaultValue?.length ?? props.value?.length ?? 0,\n );\n\n const [type, setType] = useState(typeFromProps);\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n fieldProps,\n } = useFieldComponent(props);\n\n const rootClassName = clsx(fieldProps.className, className);\n\n const propsContext: PropsContext = {\n Button: {\n className: styles.button,\n variant: \"plain\",\n color: \"secondary\",\n tunnelId: \"button\",\n },\n ...fieldPropsContext,\n };\n\n const handleChange = (v: string) => {\n if (showCharacterCount) {\n setCharactersCount(v.length);\n }\n if (props.onChange) {\n props.onChange(v);\n }\n };\n\n const translation = useLocalizedStringFormatter(locales);\n\n const charactersCountDescription = translation.format(\n \"textField.characters\",\n {\n count: charactersCount,\n maxCount: props.maxLength ?? 0,\n },\n );\n\n return (\n <Aria.TextField\n {...rest}\n {...fieldProps}\n className={rootClassName}\n onChange={handleChange}\n type={type}\n >\n <TunnelProvider>\n <PropsContextProvider props={propsContext}>\n <FieldErrorCaptureContext>\n {children}\n <div className={styles.inputContainer}>\n <Aria.Input\n form={form}\n placeholder={placeholder}\n className={styles.input}\n ref={ref}\n />\n <TunnelExit id=\"button\" />\n {typeFromProps === \"password\" && (\n <Button\n color=\"secondary\"\n variant=\"plain\"\n className={styles.button}\n onPress={() =>\n setType(type === \"password\" ? \"text\" : \"password\")\n }\n aria-label={translation.format(\n `textField.password.${type === \"password\" ? \"show\" : \"hide\"}`,\n )}\n >\n {type === \"password\" ? <IconShow /> : <IconHide />}\n </Button>\n )}\n </div>\n {showCharacterCount && (\n <FieldDescription>{charactersCountDescription}</FieldDescription>\n )}\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </PropsContextProvider>\n </TunnelProvider>\n </Aria.TextField>\n );\n});\n\nexport default TextField;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4BO,MAAM,SAAA,GAAY,aAAA,CAAc,WAAA,EAAa,CAAC,KAAA,KAAU;AAC7D,EAAA,MAAM;AAAA,IACJ,SAAA;AAAA,IACA,kBAAA;AAAA,IACA,IAAA;AAAA,IACA,WAAA;AAAA,IACA,GAAA;AAAA,IACA,IAAA,EAAM,aAAA;AAAA,IACN,QAAA;AAAA,IACA,GAAG;AAAA,GACL,GAAI,4BAA4B,KAAK,CAAA;AAErC,EAAA,MAAM,CAAC,eAAA,EAAiB,kBAAkB,CAAA,GAAI,QAAA;AAAA,IAC5C,KAAA,CAAM,YAAA,EAAc,MAAA,IAAU,KAAA,CAAM,OAAO,MAAA,IAAU;AAAA,GACvD;AAEA,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
const inputContainer = "flow--text-field--input-container";
|
|
4
|
+
const input = "flow--text-field--input";
|
|
5
|
+
const button = "flow--text-field--button";
|
|
4
6
|
const styles = {
|
|
5
|
-
|
|
7
|
+
inputContainer: inputContainer,
|
|
8
|
+
input: input,
|
|
9
|
+
button: button
|
|
6
10
|
};
|
|
7
11
|
|
|
8
|
-
export { styles as default,
|
|
12
|
+
export { button, styles as default, input, inputContainer };
|
|
9
13
|
//# sourceMappingURL=TextField.module.scss.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.module.scss.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextField.module.scss.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import styles from './Truncate.module.scss.mjs';
|
|
6
|
+
|
|
7
|
+
const Truncate = (props) => {
|
|
8
|
+
const { children, className, title } = props;
|
|
9
|
+
const rootClassName = clsx(styles.truncate, className);
|
|
10
|
+
return /* @__PURE__ */ jsx("span", { title, className: rootClassName, children });
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { Truncate, Truncate as default };
|
|
14
|
+
//# sourceMappingURL=Truncate.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Truncate.mjs","sources":["../../../../../../src/components/Truncate/Truncate.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport styles from \"./Truncate.module.scss\";\n\nexport interface TruncateProps extends PropsWithChildren, PropsWithClassName {\n title?: string;\n}\n\n/** @flr-generate all */\nexport const Truncate: FC<TruncateProps> = (props) => {\n const { children, className, title } = props;\n\n const rootClassName = clsx(styles.truncate, className);\n\n return (\n <span title={title} className={rootClassName}>\n {children}\n </span>\n );\n};\n\nexport default Truncate;\n"],"names":[],"mappings":";;;;AAUO,MAAM,QAAA,GAA8B,CAAC,KAAA,KAAU;AACpD,EAAA,MAAM,EAAE,QAAA,EAAU,SAAA,EAAW,KAAA,EAAM,GAAI,KAAA;AAEvC,EAAA,MAAM,aAAA,GAAgB,IAAA,CAAK,MAAA,CAAO,QAAA,EAAU,SAAS,CAAA;AAErD,EAAA,uBACE,GAAA,CAAC,MAAA,EAAA,EAAK,KAAA,EAAc,SAAA,EAAW,eAC5B,QAAA,EACH,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Truncate.module.scss.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
package/dist/js/default.mjs
CHANGED
|
@@ -269,6 +269,7 @@ export { TranslationProvider, useTranslationProvider } from './components/src/co
|
|
|
269
269
|
export { useLocalizedContextStringFormatter } from './components/src/components/TranslationProvider/useLocalizedContextStringFormatter.mjs';
|
|
270
270
|
export { TooltipTrigger } from './components/src/components/Tooltip/components/TooltipTrigger/TooltipTrigger.mjs';
|
|
271
271
|
export { Tooltip } from './components/src/components/Tooltip/Tooltip.mjs';
|
|
272
|
+
export { Truncate } from './components/src/components/Truncate/Truncate.mjs';
|
|
272
273
|
export { TunnelEntry } from './components/src/components/TunnelEntry/TunnelEntry.mjs';
|
|
273
274
|
export { Wrap } from './components/src/components/Wrap/Wrap.mjs';
|
|
274
275
|
export { Render } from './components/src/lib/react/components/Render/Render.mjs';
|
package/dist/js/default.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"default.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextArea.browser.test.d.ts","sourceRoot":"","sources":["../../../../src/components/TextArea/TextArea.browser.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { TextFieldBaseProps } from '../TextFieldBase';
|
|
2
1
|
import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
3
|
import * as Aria from "react-aria-components";
|
|
4
|
-
export interface TextAreaProps extends Omit<
|
|
4
|
+
export interface TextAreaProps extends PropsWithChildren<Omit<Aria.TextFieldProps, "children">>, Pick<Aria.TextAreaProps, "placeholder" | "rows" | "aria-hidden">, FlowComponentProps<HTMLTextAreaElement> {
|
|
5
|
+
/** Whether a character count should be displayed inside the field description. */
|
|
6
|
+
showCharacterCount?: boolean;
|
|
5
7
|
/**
|
|
6
8
|
* Whether the text area should grow if its content gets longer than its
|
|
7
9
|
* initial height.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../../../../src/components/TextArea/TextArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../../../../src/components/TextArea/TextArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAE9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAM/E,OAAO,EAAE,KAAK,iBAAiB,EAAuB,MAAM,OAAO,CAAC;AAMpE,MAAM,WAAW,aACf,SACE,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC,EACxD,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,aAAa,GAAG,MAAM,GAAG,aAAa,CAAC,EAChE,kBAAkB,CAAC,mBAAmB,CAAC;IACzC,kFAAkF;IAClF,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,oEAAoE;IACpE,WAAW,CAAC,EAAE,OAAO,GAAG,YAAY,GAAG,UAAU,CAAC;IAClD,6CAA6C;IAC7C,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,6CAA6C;IAC7C,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,wBAAwB;AACxB,eAAO,MAAM,QAAQ,uGAsJnB,CAAC;AAEH,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextField.browser.test.d.ts","sourceRoot":"","sources":["../../../../src/components/TextField/TextField.browser.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { TextFieldBaseProps } from '../TextFieldBase';
|
|
2
1
|
import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
|
|
3
|
-
import {
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
4
3
|
import * as Aria from "react-aria-components";
|
|
5
|
-
export interface TextFieldProps extends Omit<
|
|
4
|
+
export interface TextFieldProps extends PropsWithChildren<Omit<Aria.TextFieldProps, "children">>, Pick<Aria.InputProps, "placeholder">, FlowComponentProps<HTMLInputElement> {
|
|
5
|
+
/** Whether a character count should be displayed inside the field description. */
|
|
6
|
+
showCharacterCount?: boolean;
|
|
6
7
|
}
|
|
7
8
|
/** @flr-generate all */
|
|
8
9
|
export declare const TextField: import('react').FunctionComponent<TextFieldProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,KAAK,iBAAiB,EAAY,MAAM,OAAO,CAAC;AAazD,MAAM,WAAW,cACf,SACE,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC,EACxD,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,EACpC,kBAAkB,CAAC,gBAAgB,CAAC;IACtC,kFAAkF;IAClF,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,wBAAwB;AACxB,eAAO,MAAM,SAAS,qGAqGpB,CAAC;AAEH,eAAe,SAAS,CAAC"}
|
|
@@ -13,4 +13,6 @@ export declare const WithControlledValue: Story;
|
|
|
13
13
|
export declare const WithPlaceholder: Story;
|
|
14
14
|
export declare const WithFieldError: Story;
|
|
15
15
|
export declare const ShowCharacterCount: Story;
|
|
16
|
+
export declare const Password: Story;
|
|
17
|
+
export declare const CustomButton: Story;
|
|
16
18
|
//# sourceMappingURL=Default.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Default.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/TextField/stories/Default.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"Default.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/TextField/stories/Default.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAIrC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAQhC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAC;AAExC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,QAAQ,EAAE,KAAsC,CAAC;AAC9D,eAAO,MAAM,QAAQ,EAAE,KAAsC,CAAC;AAE9D,eAAO,MAAM,QAAQ,EAAE,KAAsC,CAAC;AAE9D,eAAO,MAAM,oBAAoB,EAAE,KAOlC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAM9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KAcjC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAM7B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAQ5B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAOhC,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAOtB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAS1B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { PropsWithClassName } from '../../lib/types/props';
|
|
3
|
+
export interface TruncateProps extends PropsWithChildren, PropsWithClassName {
|
|
4
|
+
title?: string;
|
|
5
|
+
}
|
|
6
|
+
/** @flr-generate all */
|
|
7
|
+
export declare const Truncate: FC<TruncateProps>;
|
|
8
|
+
export default Truncate;
|
|
9
|
+
//# sourceMappingURL=Truncate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Truncate.d.ts","sourceRoot":"","sources":["../../../../src/components/Truncate/Truncate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAI5D,MAAM,WAAW,aAAc,SAAQ,iBAAiB,EAAE,kBAAkB;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAwB;AACxB,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAUtC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Truncate/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AAEvB,OAAO,EAAE,KAAK,aAAa,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Truncate } from '../index';
|
|
3
|
+
declare const meta: Meta<typeof Truncate>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Truncate>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const InText: Story;
|
|
8
|
+
export declare const InHeading: Story;
|
|
9
|
+
//# sourceMappingURL=Default.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Default.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Truncate/stories/Default.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAMpC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,QAAQ,CAI/B,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEvC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,MAAM,EAAE,KAMpB,CAAC;AACF,eAAO,MAAM,SAAS,EAAE,KAMvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../../src/components/Truncate/view.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,kBAAkB;QAC1B,QAAQ,EAAE,aAAa,CAAC,OAAO,QAAQ,CAAC,CAAC;KAC1C;CACF"}
|
|
@@ -99,6 +99,7 @@ export * from './TextField';
|
|
|
99
99
|
export * from './TimeField';
|
|
100
100
|
export * from './TranslationProvider';
|
|
101
101
|
export * from './Tooltip';
|
|
102
|
+
export * from './Truncate';
|
|
102
103
|
export * from './TunnelEntry';
|
|
103
104
|
export * from './Wrap';
|
|
104
105
|
export * from '../lib/react/components/Render';
|