File tree Expand file tree Collapse file tree 5 files changed +178
-7
lines changed
internal-components/form-hint
foundation/semantic-tokens Expand file tree Collapse file tree 5 files changed +178
-7
lines changed Original file line number Diff line number Diff line change @@ -8211,6 +8211,121 @@ const blrWiFiXxs = (className: string) =>
8211
8211
/>
8212
8212
</svg>`;
8213
8213
8214
+ const PureIconKeys = [
8215
+ 'blr360',
8216
+ 'blrArrowDown',
8217
+ 'blrArrowLeft',
8218
+ 'blrArrowRight',
8219
+ 'blrArrowUp',
8220
+ 'blrBag',
8221
+ 'blrBook',
8222
+ 'blrBookmark',
8223
+ 'blrBriefcase',
8224
+ 'blrCalendar',
8225
+ 'blrCalendarToday',
8226
+ 'blrCamera',
8227
+ 'blrCart',
8228
+ 'blrChat',
8229
+ 'blrCheckmark',
8230
+ 'blrChevronDown',
8231
+ 'blrChevronLeft',
8232
+ 'blrChevronRight',
8233
+ 'blrChevronUp',
8234
+ 'blrClock0000',
8235
+ 'blrClock0030',
8236
+ 'blrClock0100',
8237
+ 'blrClock0130',
8238
+ 'blrClock0300',
8239
+ 'blrClock0330',
8240
+ 'blrClock0430',
8241
+ 'blrClock0500',
8242
+ 'blrClock0700',
8243
+ 'blrClock0730',
8244
+ 'blrClock0900',
8245
+ 'blrClock0930',
8246
+ 'blrClock1100',
8247
+ 'blrClock1130',
8248
+ 'blrClose',
8249
+ 'blrCloud',
8250
+ 'blrCloudUpload',
8251
+ 'blrCompass',
8252
+ 'blrCopy',
8253
+ 'blrCrop',
8254
+ 'blrDislike',
8255
+ 'blrDocumentNew',
8256
+ 'blrDocumentTwo',
8257
+ 'blrDownload',
8258
+ 'blrDrag',
8259
+ 'blrEnvelopeClosed',
8260
+ 'blrEnvelopeOpen',
8261
+ 'blrEqual',
8262
+ 'blrErrorFilled',
8263
+ 'blrError',
8264
+ 'blrEye',
8265
+ 'blrEyeOff',
8266
+ 'blrEyeOn',
8267
+ 'blrFlag',
8268
+ 'blrFolder',
8269
+ 'blrFolderOpen',
8270
+ 'blrFolderOpenSide',
8271
+ 'blrForward',
8272
+ 'blrGlobe',
8273
+ 'blrHeart',
8274
+ 'blrHome',
8275
+ 'blrImage',
8276
+ 'blrInboxMessageMail',
8277
+ 'blrInfo',
8278
+ 'blrLike',
8279
+ 'blrLinkBroken',
8280
+ 'blrLink',
8281
+ 'blrLockClosed',
8282
+ 'blrLockOpen',
8283
+ 'blrMenu',
8284
+ 'blrMicrophone',
8285
+ 'blrMinus',
8286
+ 'blrMoreHorizontal',
8287
+ 'blrMore',
8288
+ 'blrMoreVertical',
8289
+ 'blrMusic',
8290
+ 'blrNotificationBellOff',
8291
+ 'blrNotificationBellOn',
8292
+ 'blrPause',
8293
+ 'blrPen',
8294
+ 'blrPhoneIncomingCall',
8295
+ 'blrPhone',
8296
+ 'blrPhoneOutgoingCall',
8297
+ 'blrPin',
8298
+ 'blrPlane',
8299
+ 'blrPlay',
8300
+ 'blrPlus',
8301
+ 'blrPrinter',
8302
+ 'blrProfile',
8303
+ 'blrRefresh2',
8304
+ 'blrRefresh',
8305
+ 'blrResizeIn',
8306
+ 'blrResizeOut',
8307
+ 'blrScissors',
8308
+ 'blrSearch',
8309
+ 'blrSelectionBoxOff',
8310
+ 'blrSelectionBoxOn',
8311
+ 'blrSelectionOff',
8312
+ 'blrSelectionOn',
8313
+ 'blrSend',
8314
+ 'blrSettingsCog',
8315
+ 'blrShare',
8316
+ 'blrShoppingBasket',
8317
+ 'blroothie',
8318
+ 'blrSoundMax',
8319
+ 'blrSoundMin',
8320
+ 'blrStar',
8321
+ 'blrTag',
8322
+ 'blrTrash',
8323
+ 'blrUpload',
8324
+ 'blrVideoCamera',
8325
+ 'blrVideo',
8326
+ 'blrWiFi',
8327
+ ];
8328
+
8214
8329
export const IconMapping = {
8215
8330
blr360Lg,
8216
8331
blr360Md,
@@ -8877,5 +8992,9 @@ export const IconMapping = {
8877
8992
blrWiFiXs,
8878
8993
blrWiFiXxs,
8879
8994
};
8995
+
8880
8996
export type IconType = keyof typeof IconMapping;
8881
8997
export const IconKeys = Object.keys(IconMapping);
8998
+
8999
+ export type SizelessIconType = (typeof PureIconKeys)[number];
9000
+ export const SizelessIconKeys = PureIconKeys;
Original file line number Diff line number Diff line change @@ -3,16 +3,17 @@ import { customElement, property } from 'lit/decorators.js';
3
3
import { classMap } from 'lit/directives/class-map.js' ;
4
4
import { FormSizesType , HintVariantType } from '../../../globals/types' ;
5
5
import { BlrIconRenderFunction } from '../icon' ;
6
- import { IconType } from '@boiler/icons' ;
6
+ import { SizelessIconType } from '@boiler/icons' ;
7
7
import { form } from '../../../foundation/semantic-tokens/form.css' ;
8
8
import { calculateIconName } from '../../../utils/calculate-icon-name' ;
9
+ import { counter } from '../../../foundation/component-tokens/feedback.css' ;
9
10
10
11
@customElement ( 'blr-form-hint' )
11
12
export class BlrFormHint extends LitElement {
12
- static styles = [ form ] ;
13
+ static styles = [ counter , form ] ;
13
14
14
15
@property ( ) message ?: string ;
15
- @property ( ) icon ?: IconType ;
16
+ @property ( ) icon ?: SizelessIconType ;
16
17
@property ( ) variant : HintVariantType = 'hint' ;
17
18
@property ( ) size : FormSizesType = 'md' ;
18
19
@property ( ) childElement ?: TemplateResult < 1 > ;
Original file line number Diff line number Diff line change @@ -75,4 +75,31 @@ describe('blr-textarea', () => {
75
75
// in html disabled will become null when its false
76
76
expect ( disabled ) . to . be . equal ( null ) ;
77
77
} ) ;
78
+
79
+ it ( 'is having a a visible hint icon' , async ( ) => {
80
+ const element = await fixture (
81
+ BlrTextareaRenderFunction ( {
82
+ ...sampleParams ,
83
+ showHint : true ,
84
+ hintIcon : 'blrInfo' ,
85
+ } )
86
+ ) ;
87
+
88
+ const textarea = querySelectorDeep ( 'textarea' , element . getRootNode ( ) as HTMLElement ) ;
89
+ const formHint = querySelectorDeep ( 'blr-form-hint' , textarea ?. getRootNode ( ) as HTMLElement ) ;
90
+ const hintIcon = querySelectorDeep ( 'blr-icon' , formHint ?. getRootNode ( ) as HTMLElement ) ;
91
+ const svg = querySelectorDeep ( 'svg' , hintIcon ?. getRootNode ( ) as HTMLElement ) ;
92
+
93
+ const rect = svg ?. getBoundingClientRect ( ) ;
94
+
95
+ expect ( rect ) . have . property ( 'width' ) ;
96
+ expect ( rect ) . have . property ( 'height' ) ;
97
+ // expect(rect).have.property('x');
98
+ // expect(rect).have.property('y');
99
+
100
+ expect ( rect ?. width ) . to . be . greaterThan ( 0 ) ;
101
+ expect ( rect ?. height ) . to . be . greaterThan ( 0 ) ;
102
+ // expect((rect?.x || 0) + (rect?.width || 0)).not.to.be.lessThan(0);
103
+ // expect((rect?.y || 0) + (rect?.height || 0)).not.to.be.lessThan(0);
104
+ } ) ;
78
105
} ) ;
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import { counter } from '../../foundation/component-tokens/feedback.css';
8
8
import { FormSizesType } from '../../globals/types' ;
9
9
import { BlrFormLabelRenderFunction } from '../internal-components/form-label' ;
10
10
import { BlrFormHintRenderFunction } from '../internal-components/form-hint' ;
11
- import { IconType } from '@boiler/icons' ;
11
+ import { SizelessIconType } from '@boiler/icons' ;
12
12
import { iconButton } from '../../foundation/component-tokens/action.css' ;
13
13
14
14
@customElement ( 'blr-textarea' )
@@ -33,7 +33,7 @@ export class BlrTextarea extends LitElement {
33
33
@property ( ) errorMessage ?: string ;
34
34
@property ( ) showHint = true ;
35
35
@property ( ) hintText ?: string ;
36
- @property ( ) hintIcon : IconType = 'blrInfoSm ' ;
36
+ @property ( ) hintIcon : SizelessIconType = 'blrInfo ' ;
37
37
@property ( ) isResizeable ?: boolean ;
38
38
@property ( ) rows ?: number ;
39
39
@property ( ) cols ?: number ;
@@ -117,10 +117,9 @@ export class BlrTextarea extends LitElement {
117
117
} ) }
118
118
`
119
119
: html `< div class ="blr-form-hint ">
120
- < div class ="brl -counter ${ counterClasses } "> ${ this . count } /${ this . maxLength } </ div >
120
+ < div class ="blr -counter ${ counterClasses } "> ${ this . count } /${ this . maxLength } </ div >
121
121
</ div > `
122
122
}
123
-
124
123
</ div >
125
124
</ div>
126
125
` ;
Original file line number Diff line number Diff line change @@ -178,6 +178,31 @@ export const form = css`
178
178
padding-bottom : ${ Forms . LG . LabelSlot . Padding } ;
179
179
}
180
180
}
181
+ .blr-counter {
182
+ & .sm {
183
+ font-family : ${ Forms . SM . Caption . fontFamily } , sans-serif;
184
+ font-weight : ${ Forms . SM . Caption . fontWeight } ;
185
+ font-size : ${ Forms . SM . Caption . fontSize } ;
186
+ font-family : ${ Forms . SM . Caption . fontFamily } , sans-serif;
187
+ line-height : ${ Forms . SM . Caption . lineHeight } ;
188
+ }
189
+
190
+ & .md {
191
+ font-family : ${ Forms . MD . Caption . fontFamily } , sans-serif;
192
+ font-weight : ${ Forms . MD . Caption . fontWeight } ;
193
+ font-size : ${ Forms . MD . Caption . fontSize } ;
194
+ font-family : ${ Forms . MD . Caption . fontFamily } , sans-serif;
195
+ line-height : ${ Forms . MD . Caption . lineHeight } ;
196
+ }
197
+
198
+ & .md {
199
+ font-family : ${ Forms . LG . Caption . fontFamily } , sans-serif;
200
+ font-weight : ${ Forms . LG . Caption . fontWeight } ;
201
+ font-size : ${ Forms . LG . Caption . fontSize } ;
202
+ font-family : ${ Forms . LG . Caption . fontFamily } , sans-serif;
203
+ line-height : ${ Forms . LG . Caption . lineHeight } ;
204
+ }
205
+ }
181
206
.blr-form-hint , .blr-counter {
182
207
display : flex;
183
208
align-items : flex-start;
You can’t perform that action at this time.
0 commit comments