File tree Expand file tree Collapse file tree 5 files changed +55
-0
lines changed
packages/components/src/styles/components/form
showcase/app/components/page-components/form/file-input Expand file tree Collapse file tree 5 files changed +55
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @hashicorp/design-system-components " : patch
3+ ---
4+
5+ <!-- START components/form/file-input -->
6+ ` FileInput ` - Added width of 100% to prevent the component from overflowing its container and making it consistent with other Input components
7+ <!-- END -->
Original file line number Diff line number Diff line change 1010@use " ../../mixins/button" as * ;
1111
1212.hds-form-file-input {
13+ width : 100% ; // we want to prevent the input from overflowing its container
1314 margin : -4px 0 -4px -4px ; // offset shadow padding + default 1px spacing
1415 padding : 3px 0 3px 3px ; // add padding so button shadow is visible
1516 color : var (--token-color-foreground-primary );
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import ShwTextH1 from 'showcase/components/shw/text/h1';
1111
1212import SubSectionBaseControl from ' showcase/components/page-components/form/file-input/sub-sections/base-control' ;
1313import SubSectionFieldControl from ' showcase/components/page-components/form/file-input/sub-sections/field-control' ;
14+ import SubSectionContainers from ' showcase/components/page-components/form/file-input/sub-sections/containers' ;
1415
1516export default class FormFileInputIndex extends Component {
1617 @tracked showHighlight = false ;
@@ -35,6 +36,7 @@ export default class FormFileInputIndex extends Component {
3536 </button >
3637 <SubSectionBaseControl @ showHighlight ={{this .showHighlight }} />
3738 <SubSectionFieldControl @ showHighlight ={{this .showHighlight }} />
39+ <SubSectionContainers @ showHighlight ={{this .showHighlight }} />
3840 </section >
3941 </template >
4042}
Original file line number Diff line number Diff line change 1+ /**
2+ * Copyright (c) HashiCorp, Inc.
3+ * SPDX-License-Identifier: MPL-2.0
4+ */
5+ import type { TemplateOnlyComponent } from ' @ember/component/template-only' ;
6+ import style from ' ember-style-modifier' ;
7+
8+ import ShwFlex from ' showcase/components/shw/flex' ;
9+ import ShwTextH2 from ' showcase/components/shw/text/h2' ;
10+ import ShwOutliner from ' showcase/components/shw/outliner' ;
11+
12+ import { HdsFormFileInputField } from ' @hashicorp/design-system-components/components' ;
13+
14+ export interface SubSectionContainersSignature {
15+ Args: {
16+ showHighlight: boolean ;
17+ };
18+ }
19+
20+ const SubSectionContainers: TemplateOnlyComponent <SubSectionContainersSignature > =
21+ <template >
22+ <ShwTextH2 >Containers</ShwTextH2 >
23+
24+ <div
25+ class =" {{if
26+ @ showHighlight
27+ ' shw-component-form-file-input-layout-highlight'
28+ }} "
29+ >
30+ <ShwFlex @ gap =" 2rem" as | SF | >
31+ <SF.Item @ label =" Within a fixed-width container" >
32+ <ShwOutliner {{style width =" 220px" }} >
33+ <HdsFormFileInputField as | F | >
34+ <F.Label >This is the label text</F.Label >
35+ <F.HelperText >This is the helper text with longer wrapping text</F.HelperText >
36+ </HdsFormFileInputField >
37+ </ShwOutliner >
38+ </SF.Item >
39+ </ShwFlex >
40+ </div >
41+ </template >;
42+
43+ export default SubSectionContainers ;
Original file line number Diff line number Diff line change @@ -87,6 +87,8 @@ const SubSectionFieldControl: TemplateOnlyComponent<SubSectionFieldControlSignat
8787 </HdsFormFileInputField >
8888 </SG.Item >
8989 </ShwGrid >
90+
91+ <ShwDivider />
9092 </template >;
9193
9294export default SubSectionFieldControl ;
You can’t perform that action at this time.
0 commit comments