Skip to content

Commit 04b1a87

Browse files
committed
chore(pds-text): add add span tag
1 parent 52fface commit 04b1a87

File tree

3 files changed

+21
-134
lines changed

3 files changed

+21
-134
lines changed

libs/core/src/components.d.ts

Lines changed: 14 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -2072,66 +2072,32 @@ export namespace Components {
20722072
/**
20732073
* Sets the text decoration.
20742074
*/
2075-
"decoration"?: | 'strikethrough'
2076-
| 'underline-dotted';
2075+
"decoration"?: 'strikethrough' | 'underline-dotted';
20772076
/**
20782077
* Set the bottom margin for the text.
20792078
*/
2080-
"gutter"?: | '2xl'
2081-
| 'xl'
2082-
| 'lg'
2083-
| 'md'
2084-
| 'sm'
2085-
| 'xs'
2086-
| '2xs';
2079+
"gutter"?: '2xl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs' | '2xs';
20872080
/**
20882081
* If set or `true`, the text will be italic.
20892082
*/
20902083
"italic"?: boolean;
20912084
/**
20922085
* Sets the font size.
20932086
*/
2094-
"size"?: | '2xl'
2095-
| 'xl'
2096-
| 'lg'
2097-
| 'md'
2098-
| 'sm'
2099-
| 'xs'
2100-
| '2xs'
2101-
| 'h1'
2102-
| 'h2'
2103-
| 'h3'
2104-
| 'h4'
2105-
| 'h5'
2106-
| 'h6';
2087+
"size"?: '2xl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs' | '2xs' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
21072088
/**
21082089
* Determines what semantic text tag to render.
2109-
* @default "p"
2110-
*/
2111-
"tag": | 'h1'
2112-
| 'h2'
2113-
| 'h3'
2114-
| 'h4'
2115-
| 'h5'
2116-
| 'h6'
2117-
| 'p'
2118-
| 'code'
2119-
| 'pre'
2120-
| 'strong'
2121-
| 'em';
2090+
* @default 'p'
2091+
*/
2092+
"tag": 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'code' | 'pre' | 'strong' | 'em';
21222093
/**
21232094
* If set or `true`, the text will be truncated. Must add a `width` to the element. When text overflows, a tooltip showing the full text will appear on hover/focus. Note: When truncate is enabled, the element automatically receives tabindex="0" for keyboard accessibility.
21242095
*/
21252096
"truncate"?: boolean;
21262097
/**
21272098
* Sets the font weight.
21282099
*/
2129-
"weight"?: | 'extra-light'
2130-
| 'light'
2131-
| 'regular'
2132-
| 'medium'
2133-
| 'semibold'
2134-
| 'bold';
2100+
"weight"?: 'extra-light' | 'light' | 'regular' | 'medium' | 'semibold' | 'bold';
21352101
}
21362102
interface PdsTextarea {
21372103
/**
@@ -5169,66 +5135,32 @@ declare namespace LocalJSX {
51695135
/**
51705136
* Sets the text decoration.
51715137
*/
5172-
"decoration"?: | 'strikethrough'
5173-
| 'underline-dotted';
5138+
"decoration"?: 'strikethrough' | 'underline-dotted';
51745139
/**
51755140
* Set the bottom margin for the text.
51765141
*/
5177-
"gutter"?: | '2xl'
5178-
| 'xl'
5179-
| 'lg'
5180-
| 'md'
5181-
| 'sm'
5182-
| 'xs'
5183-
| '2xs';
5142+
"gutter"?: '2xl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs' | '2xs';
51845143
/**
51855144
* If set or `true`, the text will be italic.
51865145
*/
51875146
"italic"?: boolean;
51885147
/**
51895148
* Sets the font size.
51905149
*/
5191-
"size"?: | '2xl'
5192-
| 'xl'
5193-
| 'lg'
5194-
| 'md'
5195-
| 'sm'
5196-
| 'xs'
5197-
| '2xs'
5198-
| 'h1'
5199-
| 'h2'
5200-
| 'h3'
5201-
| 'h4'
5202-
| 'h5'
5203-
| 'h6';
5150+
"size"?: '2xl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs' | '2xs' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
52045151
/**
52055152
* Determines what semantic text tag to render.
5206-
* @default "p"
5207-
*/
5208-
"tag"?: | 'h1'
5209-
| 'h2'
5210-
| 'h3'
5211-
| 'h4'
5212-
| 'h5'
5213-
| 'h6'
5214-
| 'p'
5215-
| 'code'
5216-
| 'pre'
5217-
| 'strong'
5218-
| 'em';
5153+
* @default 'p'
5154+
*/
5155+
"tag"?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'code' | 'pre' | 'strong' | 'em';
52195156
/**
52205157
* If set or `true`, the text will be truncated. Must add a `width` to the element. When text overflows, a tooltip showing the full text will appear on hover/focus. Note: When truncate is enabled, the element automatically receives tabindex="0" for keyboard accessibility.
52215158
*/
52225159
"truncate"?: boolean;
52235160
/**
52245161
* Sets the font weight.
52255162
*/
5226-
"weight"?: | 'extra-light'
5227-
| 'light'
5228-
| 'regular'
5229-
| 'medium'
5230-
| 'semibold'
5231-
| 'bold';
5163+
"weight"?: 'extra-light' | 'light' | 'regular' | 'medium' | 'semibold' | 'bold';
52325164
}
52335165
interface PdsTextarea {
52345166
/**

libs/core/src/components/pds-text/pds-text.tsx

Lines changed: 6 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,12 @@ export class PdsText {
2727
/**
2828
* Sets the text decoration.
2929
*/
30-
@Prop() decoration?:
31-
| 'strikethrough'
32-
| 'underline-dotted';
30+
@Prop() decoration?: 'strikethrough' | 'underline-dotted';
3331

3432
/**
3533
* Set the bottom margin for the text.
3634
*/
37-
@Prop() gutter?:
38-
| '2xl'
39-
| 'xl'
40-
| 'lg'
41-
| 'md'
42-
| 'sm'
43-
| 'xs'
44-
| '2xs';
35+
@Prop() gutter?: '2xl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs' | '2xs';
4536

4637
/**
4738
* If set or `true`, the text will be italic.
@@ -51,47 +42,17 @@ export class PdsText {
5142
/**
5243
* Sets the font size.
5344
*/
54-
@Prop() size?:
55-
| '2xl'
56-
| 'xl'
57-
| 'lg'
58-
| 'md'
59-
| 'sm'
60-
| 'xs'
61-
| '2xs'
62-
| 'h1'
63-
| 'h2'
64-
| 'h3'
65-
| 'h4'
66-
| 'h5'
67-
| 'h6';
45+
@Prop() size?: '2xl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs' | '2xs' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
6846

6947
/**
7048
* Sets the font weight.
7149
*/
72-
@Prop() weight?:
73-
| 'extra-light'
74-
| 'light'
75-
| 'regular'
76-
| 'medium'
77-
| 'semibold'
78-
| 'bold';
50+
@Prop() weight?: 'extra-light' | 'light' | 'regular' | 'medium' | 'semibold' | 'bold';
7951

8052
/**
8153
* Determines what semantic text tag to render.
8254
*/
83-
@Prop() tag:
84-
| 'h1'
85-
| 'h2'
86-
| 'h3'
87-
| 'h4'
88-
| 'h5'
89-
| 'h6'
90-
| 'p'
91-
| 'code'
92-
| 'pre'
93-
| 'strong'
94-
| 'em' = "p";
55+
@Prop() tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'code' | 'pre' | 'strong' | 'em' = 'p';
9556

9657
/**
9758
* If set or `true`, the text will be truncated. Must add a `width` to the element.
@@ -152,13 +113,7 @@ export class PdsText {
152113
`;
153114

154115
return (
155-
<Tag
156-
ref={(el) => this.contentEl = el}
157-
style={this.color && setColor(this.color)}
158-
class={typeClasses}
159-
part="content"
160-
tabIndex={this.truncate ? 0 : undefined}
161-
>
116+
<Tag ref={(el) => (this.contentEl = el)} style={this.color && setColor(this.color)} class={typeClasses} part="content" tabIndex={this.truncate ? 0 : undefined}>
162117
<slot />
163118
</Tag>
164119
);

libs/core/src/components/pds-text/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
| `gutter` | `gutter` | Set the bottom margin for the text. | `"2xl" \| "2xs" \| "lg" \| "md" \| "sm" \| "xl" \| "xs"` | `undefined` |
1616
| `italic` | `italic` | If set or `true`, the text will be italic. | `boolean` | `undefined` |
1717
| `size` | `size` | Sets the font size. | `"2xl" \| "2xs" \| "h1" \| "h2" \| "h3" \| "h4" \| "h5" \| "h6" \| "lg" \| "md" \| "sm" \| "xl" \| "xs"` | `undefined` |
18-
| `tag` | `tag` | Determines what semantic text tag to render. | `"code" \| "em" \| "h1" \| "h2" \| "h3" \| "h4" \| "h5" \| "h6" \| "p" \| "pre" \| "strong"` | `"p"` |
18+
| `tag` | `tag` | Determines what semantic text tag to render. | `"code" \| "em" \| "h1" \| "h2" \| "h3" \| "h4" \| "h5" \| "h6" \| "p" \| "pre" \| "span" \| "strong"` | `'p'` |
1919
| `truncate` | `truncate` | If set or `true`, the text will be truncated. Must add a `width` to the element. When text overflows, a tooltip showing the full text will appear on hover/focus. Note: When truncate is enabled, the element automatically receives tabindex="0" for keyboard accessibility. | `boolean` | `undefined` |
2020
| `weight` | `weight` | Sets the font weight. | `"bold" \| "extra-light" \| "light" \| "medium" \| "regular" \| "semibold"` | `undefined` |
2121

0 commit comments

Comments
 (0)