Skip to content

Commit e98dfe0

Browse files
committed
Updated tokens in the theme generator
1 parent aa7a755 commit e98dfe0

File tree

5 files changed

+50
-22
lines changed

5 files changed

+50
-22
lines changed

website/screens/theme-generator/components/previews/Checkbox.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,19 @@ const Checkbox = () => {
1212
return (
1313
<PreviewContainer>
1414
<Mode text="Default">
15-
<DxcCheckbox checked={checked} label="Checkbox" onChange={onChange} />
15+
<DxcCheckbox checked={checked} label="Label text" onChange={onChange} />
1616
</Mode>
1717
<Mode text="Label position">
1818
<DxcCheckbox label="Label before" />
1919
<DxcCheckbox labelPosition="after" label="Label after" />
2020
</Mode>
2121
<Mode text="Disabled">
22-
<DxcCheckbox label="Disabled" disabled />
23-
<DxcCheckbox label="Disabled Checked" checked disabled />
22+
<DxcCheckbox label="Label text" disabled />
23+
<DxcCheckbox label="Label text" checked disabled />
24+
</Mode>
25+
<Mode text="Read-only">
26+
<DxcCheckbox label="Label text" readOnly />
27+
<DxcCheckbox label="Label text" checked readOnly />
2428
</Mode>
2529
</PreviewContainer>
2630
);

website/screens/theme-generator/components/previews/RadioGroup.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const single_disabled_options = [
1616

1717
const RadioGroup = () => (
1818
<PreviewContainer>
19-
<Mode text="Default">
19+
<Mode text="States">
2020
<DxcRadioGroup label="Default" defaultValue="A" options={options} />
2121
<DxcRadioGroup
2222
label="Error"
@@ -25,10 +25,10 @@ const RadioGroup = () => (
2525
error="Error message"
2626
/>
2727
<DxcRadioGroup
28-
label="Readonly"
28+
label="Read-only"
2929
defaultValue="A"
3030
options={options}
31-
readonly
31+
readOnly
3232
/>
3333
</Mode>
3434
<Mode text="Disabled">
@@ -46,7 +46,7 @@ const RadioGroup = () => (
4646
</Mode>
4747
<Mode text="Optional">
4848
<DxcRadioGroup
49-
label="Optional"
49+
label="Label text"
5050
helperText="Adds a predefined option whose value is the empty string"
5151
options={options}
5252
optional

website/screens/theme-generator/components/previews/TextInput.tsx

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,24 +59,30 @@ const errorCallbackFunc: (value: string) => Promise<string[]> = (): Promise<
5959

6060
const TextInput = () => (
6161
<PreviewContainer>
62-
<Mode text="Default">
62+
<Mode text="States">
6363
<DxcTextInput
64-
label="Label"
64+
label="Default"
6565
clearable
6666
defaultValue="Example text"
6767
size="fillParent"
6868
/>
6969
<DxcTextInput
70-
label="Invalid text input"
70+
label="Error"
7171
placeholder="Placeholder"
7272
error="Error message."
7373
clearable
7474
size="fillParent"
7575
/>
76+
<DxcTextInput
77+
label="Read-only"
78+
defaultValue="Example text"
79+
readOnly
80+
size="fillParent"
81+
/>
7682
</Mode>
7783
<Mode text="Disabled">
7884
<DxcTextInput
79-
label="Disabled text input"
85+
label="Label text"
8086
helperText="Helper text"
8187
defaultValue="Example text"
8288
action={action}
@@ -85,7 +91,7 @@ const TextInput = () => (
8591
size="fillParent"
8692
/>
8793
<DxcTextInput
88-
label="Disabled text input"
94+
label="Label text"
8995
placeholder="Placeholder"
9096
helperText="Helper text"
9197
suffix="Suf"
@@ -95,7 +101,7 @@ const TextInput = () => (
95101
</Mode>
96102
<Mode text="Action & Optional">
97103
<DxcTextInput
98-
label="Text input with action and optional"
104+
label="Label text"
99105
helperText="Example of helper text"
100106
placeholder="Placeholder"
101107
action={action}
@@ -105,7 +111,7 @@ const TextInput = () => (
105111
</Mode>
106112
<Mode text="Prefix & Suffix">
107113
<DxcTextInput
108-
label="Prefix and suffix text input"
114+
label="Label text"
109115
prefix="+34"
110116
suffix="USD"
111117
helperText="Example of helper text"
@@ -114,14 +120,14 @@ const TextInput = () => (
114120
</Mode>
115121
<Mode text="Suggestions">
116122
<DxcTextInput
117-
label="Suggestions text input"
123+
label="Label text"
118124
placeholder="Placeholder"
119125
suggestions={countries}
120126
clearable
121127
size="fillParent"
122128
/>
123129
<DxcTextInput
124-
label="Suggestions error text input"
130+
label="Label text"
125131
placeholder="Placeholder"
126132
suggestions={errorCallbackFunc}
127133
clearable

website/screens/theme-generator/components/previews/Textarea.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,37 @@ const Textarea = () => (
77
<PreviewContainer>
88
<Mode text="Default">
99
<DxcTextarea
10-
label="Regular textarea"
10+
label="Label text"
1111
helperText="Example of helper text"
1212
optional
1313
verticalGrow="manual"
1414
/>
1515
</Mode>
1616
<Mode text="Disabled">
1717
<DxcTextarea
18-
label="Disabled textarea"
18+
label="Label text"
1919
helperText="Example of helper text"
2020
placeholder="Placeholder"
2121
disabled
2222
/>
2323
</Mode>
2424
<Mode text="Invalid">
2525
<DxcTextarea
26-
label="Invalid textarea"
26+
label="Label text"
2727
helperText="Example of helper text"
2828
placeholder="Placeholder"
2929
error="Error message."
3030
/>
3131
</Mode>
32+
<Mode text="Read-only">
33+
<DxcTextarea
34+
label="Label text"
35+
helperText="Example of helper text"
36+
defaultValue="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
37+
placeholder="Placeholder"
38+
readOnly
39+
/>
40+
</Mode>
3241
</PreviewContainer>
3342
);
3443

website/screens/theme-generator/themes/schemas/advanced.schema.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,16 +197,21 @@
197197
"hoverBackgroundColorCheckedOnDark": "color",
198198
"disabledBackgroundColorChecked": "color",
199199
"disabledBackgroundColorCheckedOnDark": "color",
200+
"readOnlyBackgroundColorChecked": "color",
201+
"hoverReadOnlyBackgroundColorChecked": "color",
200202
"borderColor": "color",
201203
"borderColorOnDark": "color",
202204
"hoverBorderColor": "color",
203205
"hoverBorderColorOnDark": "color",
204206
"disabledBorderColor": "color",
205207
"disabledBorderColorOnDark": "color",
208+
"readOnlyBorderColor": "color",
209+
"hoverReadOnlyBorderColor": "color",
206210
"checkColor": "color",
207211
"checkColorOnDark": "color",
208212
"disabledCheckColor": "color",
209213
"disabledCheckColorOnDark": "color",
214+
"readOnlyCheckColor": "color",
210215
"fontFamily": "fFamily",
211216
"fontSize": "length",
212217
"fontWeight": "fWeight",
@@ -616,9 +621,9 @@
616621
"errorRadioInputColor": "color",
617622
"hoverErrorRadioInputColor": "color",
618623
"activeErrorRadioInputColor": "color",
619-
"readonlyRadioInputColor": "color",
620-
"hoverReadonlyRadioInputColor": "color",
621-
"activeReadonlyRadioInputColor": "color",
624+
"readOnlyRadioInputColor": "color",
625+
"hoverReadOnlyRadioInputColor": "color",
626+
"activeReadOnlyRadioInputColor": "color",
622627
"disabledRadioInputColor": "color",
623628
"disabledLabelFontColor": "color",
624629
"disabledHelperTextFontColor": "color",
@@ -1000,6 +1005,8 @@
10001005
"disabledBorderColorOnDark": "color",
10011006
"disabledContainerFillColor": "color",
10021007
"disabledContainerFillColorOnDark": "color",
1008+
"readOnlyBorderColor": "color",
1009+
"hoverReadOnlyBorderColor": "color",
10031010
"errorBorderColor": "color",
10041011
"errorBorderColorOnDark": "color",
10051012
"hoverErrorBorderColor": "color",
@@ -1049,6 +1056,8 @@
10491056
"disabledBorderColorOnDark": "color",
10501057
"disabledContainerFillColor": "color",
10511058
"disabledContainerFillColorOnDark": "color",
1059+
"readOnlyBorderColor": "color",
1060+
"hoverReadOnlyBorderColor": "color",
10521061
"errorBorderColor": "color",
10531062
"errorBorderColorOnDark": "color",
10541063
"hoverErrorBorderColor": "color",

0 commit comments

Comments
 (0)