@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.
Files changed (42) hide show
  1. package/.storybook/main.js +0 -1
  2. package/components/MadieTooltip/index.jsx +7 -1
  3. package/components/RichTextEditor/index.jsx +7 -6
  4. package/components/TextField/TextField.stories.js +19 -0
  5. package/components/TextField/index.jsx +69 -22
  6. package/dist/browser.js +1 -1
  7. package/dist/index.js +1 -1
  8. package/dist/react/index.js +5 -5
  9. package/dist/react/index.js.LICENSE.txt +21 -1
  10. package/dist/react/index.js.map +1 -1
  11. package/package.json +13 -14
  12. package/storybook-static/favicon.svg +1 -0
  13. package/storybook-static/index.html +169 -0
  14. package/storybook-static/index.json +1 -0
  15. package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
  16. package/storybook-static/nunito-sans-bold.woff2 +0 -0
  17. package/storybook-static/nunito-sans-italic.woff2 +0 -0
  18. package/storybook-static/nunito-sans-regular.woff2 +0 -0
  19. package/storybook-static/project.json +1 -0
  20. package/storybook-static/sb-addons/a11y-5/manager-bundle.js +220 -0
  21. package/storybook-static/sb-addons/actions-1/manager-bundle.js +3 -0
  22. package/storybook-static/sb-addons/backgrounds-7/manager-bundle.js +12 -0
  23. package/storybook-static/sb-addons/docs-6/manager-bundle.js +245 -0
  24. package/storybook-static/sb-addons/knobs-4/register-bundle.js +23 -0
  25. package/storybook-static/sb-addons/knobs-4/register-bundle.js.LEGAL.txt +11 -0
  26. package/storybook-static/sb-addons/links-2/manager-bundle.js +3 -0
  27. package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
  28. package/storybook-static/sb-addons/storysource-3/manager-bundle.js +3 -0
  29. package/storybook-static/sb-addons/viewport-8/manager-bundle.js +3 -0
  30. package/storybook-static/sb-common-assets/favicon.svg +1 -0
  31. package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  32. package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  33. package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  34. package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  35. package/storybook-static/sb-manager/globals-module-info.js +1052 -0
  36. package/storybook-static/sb-manager/globals-runtime.js +41775 -0
  37. package/storybook-static/sb-manager/globals.js +48 -0
  38. package/storybook-static/sb-manager/runtime.js +12048 -0
  39. package/storybook-static/sb-preview/globals.js +33 -0
  40. package/storybook-static/sb-preview/runtime.js +7745 -0
  41. package/test/components/TextField.test.js +45 -0
  42. 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"];