@madie/madie-design-system 1.2.95 → 1.2.97
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/.storybook/main.js +0 -1
- package/components/MadieTooltip/index.jsx +7 -1
- package/components/RichTextEditor/index.jsx +7 -6
- package/components/TextField/TextField.stories.js +19 -0
- package/components/TextField/index.jsx +69 -22
- package/dist/browser.js +1 -1
- package/dist/index.js +1 -1
- package/dist/react/index.js +5 -5
- package/dist/react/index.js.LICENSE.txt +21 -1
- package/dist/react/index.js.map +1 -1
- package/package.json +13 -14
- package/storybook-static/favicon.svg +1 -0
- package/storybook-static/index.html +169 -0
- package/storybook-static/index.json +1 -0
- package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/project.json +1 -0
- package/storybook-static/sb-addons/a11y-5/manager-bundle.js +220 -0
- package/storybook-static/sb-addons/actions-1/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/backgrounds-7/manager-bundle.js +12 -0
- package/storybook-static/sb-addons/docs-6/manager-bundle.js +245 -0
- package/storybook-static/sb-addons/knobs-4/register-bundle.js +23 -0
- package/storybook-static/sb-addons/knobs-4/register-bundle.js.LEGAL.txt +11 -0
- package/storybook-static/sb-addons/links-2/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
- package/storybook-static/sb-addons/storysource-3/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/viewport-8/manager-bundle.js +3 -0
- package/storybook-static/sb-common-assets/favicon.svg +1 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/sb-manager/globals-module-info.js +1052 -0
- package/storybook-static/sb-manager/globals-runtime.js +41775 -0
- package/storybook-static/sb-manager/globals.js +48 -0
- package/storybook-static/sb-manager/runtime.js +12048 -0
- package/storybook-static/sb-preview/globals.js +33 -0
- package/storybook-static/sb-preview/runtime.js +7745 -0
- package/test/components/TextField.test.js +45 -0
- package/webpack.config.js +0 -1
|
@@ -178,4 +178,49 @@ describe("TextField", () => {
|
|
|
178
178
|
expect(maxLength).toBeInTheDocument();
|
|
179
179
|
});
|
|
180
180
|
});
|
|
181
|
+
|
|
182
|
+
test("recommendation text and max length share a row with left/right layout", async () => {
|
|
183
|
+
act(async () => {
|
|
184
|
+
const longRecommendation =
|
|
185
|
+
"This recommendation is intentionally long so it can wrap without overlapping the character counter.";
|
|
186
|
+
const {findByTestId, findByText} = render(
|
|
187
|
+
<TextField
|
|
188
|
+
placeholder="test Name"
|
|
189
|
+
label="test Name"
|
|
190
|
+
id="testName"
|
|
191
|
+
inputProps={{"data-testid": "test-name-input"}}
|
|
192
|
+
data-testid="test-name-text-field"
|
|
193
|
+
size="small"
|
|
194
|
+
value="abc"
|
|
195
|
+
maxLength={10}
|
|
196
|
+
recommendation={longRecommendation}
|
|
197
|
+
tooltipText="tooltip text"
|
|
198
|
+
helperText="helper text"
|
|
199
|
+
/>
|
|
200
|
+
);
|
|
201
|
+
|
|
202
|
+
const recommendationNode = await findByTestId("testName-recommendation-text");
|
|
203
|
+
const maxLengthNode = await findByText("3/10 Characters");
|
|
204
|
+
|
|
205
|
+
expect(recommendationNode).toBeInTheDocument();
|
|
206
|
+
expect(maxLengthNode).toBeInTheDocument();
|
|
207
|
+
|
|
208
|
+
const recommendationContainer = recommendationNode.parentElement;
|
|
209
|
+
const footerRow = recommendationContainer?.parentElement;
|
|
210
|
+
|
|
211
|
+
expect(recommendationContainer).toHaveStyle("flex: 1");
|
|
212
|
+
expect(recommendationContainer).toHaveStyle("min-width: 0");
|
|
213
|
+
expect(footerRow).toHaveStyle("display: flex");
|
|
214
|
+
expect(footerRow).toHaveStyle("justify-content: space-between");
|
|
215
|
+
expect(maxLengthNode).toHaveStyle("white-space: nowrap");
|
|
216
|
+
|
|
217
|
+
// 508 compliance
|
|
218
|
+
const textNode = await findByTestId("test-name-input");
|
|
219
|
+
const describedBy = textNode.getAttribute("aria-describedby") || "";
|
|
220
|
+
|
|
221
|
+
expect(describedBy).toContain("testName-helper-text");
|
|
222
|
+
expect(describedBy).toContain("testName-tooltip");
|
|
223
|
+
expect(describedBy).toContain("testName-recommendation-text");
|
|
224
|
+
});
|
|
225
|
+
});
|
|
181
226
|
});
|
package/webpack.config.js
CHANGED
|
@@ -2,7 +2,6 @@ const path = require("path");
|
|
|
2
2
|
const webpack = require("webpack");
|
|
3
3
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
|
4
4
|
const TerserPlugin = require("terser-webpack-plugin");
|
|
5
|
-
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
|
6
5
|
|
|
7
6
|
const pkg = require("./package.json");
|
|
8
7
|
const entry = ["./index.js"];
|