From 51fa2f411f48f56bc4b1aa21bab228b632402a20 Mon Sep 17 00:00:00 2001 From: Robert Tran Date: Wed, 22 Nov 2023 15:48:04 +0100 Subject: [PATCH] feat(cc-input-text): adds label style customization Fixes #888 --- src/components/cc-input-text/cc-input-text.js | 25 +++++--- .../cc-input-text/cc-input-text.stories.js | 62 +++++++++++++++++++ 2 files changed, 77 insertions(+), 10 deletions(-) diff --git a/src/components/cc-input-text/cc-input-text.js b/src/components/cc-input-text/cc-input-text.js index 875dcbbc8..35313120a 100644 --- a/src/components/cc-input-text/cc-input-text.js +++ b/src/components/cc-input-text/cc-input-text.js @@ -35,6 +35,9 @@ const TAG_SEPARATOR = ' '; * * @cssprop {Color} --cc-input-btn-icon-color - The color for the icon within the clipboard/secret button (defaults: `#595959`). * @cssprop {FontFamily} --cc-input-font-family - The font-family for the input content (defaults: `inherit` or `--cc-ff-monospace` when using the tags mode). + * @cssprop {Color} --cc-input-label-color - The color for the input's label (defaults: `inherit`). + * @cssprop {FontSize} --cc-input-label-font-size - The font-size for the input's label (defaults: `inherit`). + * @cssprop {FontWeight} --cc-input-label-font-weight - The font-weight for the input's label (defaults: `normal`). * * @slot error - The error message to be displayed below the `` element or below the help text. Please use a `

` tag. * @slot help - The help message to be displayed right below the `` element. Please use a `

` tag. @@ -228,7 +231,7 @@ export class CcInputText extends LitElement { ${this.label != null ? html`

Must be at least 7 characters long

`, + })), + ...customBaseItems.map((item) => ({ + ...item, + innerHTML: `

You must enter a value

`, + })), + ...customBaseItems.map((item) => ({ + ...item, + innerHTML: `

Must be at least 7 characters long

You must enter a value

`, + })), + ...customBaseItems.map((item) => ({ + ...item, + inline: true, + })), + ...customBaseItems.map((item) => ({ + ...item, + inline: true, + innerHTML: `

Must be at least 7 characters long

`, + })), + ...customBaseItems.map((item) => ({ + ...item, + inline: true, + innerHTML: `

You must enter a value

`, + })), + ...customBaseItems.map((item) => ({ + ...item, + inline: true, + innerHTML: `

Must be at least 7 characters long

You must enter a value

`, + })), + ], +}); + export const allFormControls = allFormControlsStory; export const simulation = makeStory(conf, {