odaptos_design_system 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.0",
2
+ "version": "0.1.2",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -70,6 +70,7 @@
70
70
  "react-is": "^18.2.0",
71
71
  "size-limit": "^8.2.4",
72
72
  "storybook": "^7.0.8",
73
+ "storybook-design-token": "^3.0.0-beta.3",
73
74
  "tsdx": "^0.14.1",
74
75
  "tslib": "^2.5.0",
75
76
  "typescript": "^3.9.10"
@@ -0,0 +1,17 @@
1
+ @import '../../../example/index.css';
2
+
3
+ .text {
4
+ font-family: var(--sdFontFamilyOpenSans);
5
+ font-style: normal;
6
+ font-weight: var(--sdFontWeightRegular);
7
+ font-size: var(--sdFontSizeXs);
8
+ line-height: var(--sdLineHeight130);
9
+ letter-spacing: var(--sdLetterSpacingButtons);
10
+ padding: 1px 0px;
11
+ text-align: left;
12
+ margin: unset;
13
+ }
14
+
15
+ .text.uppercase {
16
+ text-transform: var(--sdTextCaseUppercase);
17
+ }
@@ -0,0 +1,29 @@
1
+ import React, { HTMLAttributes } from 'react';
2
+ import './Caption.css';
3
+
4
+ interface CaptionProps extends HTMLAttributes<HTMLParagraphElement> {
5
+ /** Text display in the caption */
6
+ text: string;
7
+ color?: string;
8
+ className?: string;
9
+ uppercase?: boolean;
10
+ }
11
+
12
+ /** This text should only be used for the captions */
13
+ export const Caption = ({
14
+ text = 'Caption text',
15
+ color = 'black',
16
+ className,
17
+ uppercase = true,
18
+ ...props
19
+ }: CaptionProps) => {
20
+ return (
21
+ <p
22
+ {...props}
23
+ style={{ color: color }}
24
+ className={`text ${uppercase && 'uppercase'} ${className}`}
25
+ >
26
+ {text}
27
+ </p>
28
+ );
29
+ };
@@ -0,0 +1,272 @@
1
+ @import '../../../example/index.css';
2
+
3
+ .text {
4
+ font-family: var(--sdFontFamilyOpenSans);
5
+ font-style: normal;
6
+ font-weight: var(--sdFontWeightRegular);
7
+ font-size: var(--sdFontSizeXs);
8
+ line-height: var(--sdLineHeight130);
9
+ letter-spacing: var(--sdLetterSpacingButtons);
10
+ text-align: left;
11
+ margin: unset;
12
+ }
13
+
14
+ .underline {
15
+ text-decoration: var(--sdUnderline);
16
+ }
17
+
18
+ .line-through {
19
+ text-decoration: var(--sdLineThrough);
20
+ }
21
+
22
+ /* Regular */
23
+
24
+ .text.xs.regular {
25
+ font: var(--sdTypoTextNoDecorationRegularXs);
26
+ padding: 1px 0px;
27
+ }
28
+
29
+ .text.sm.regular {
30
+ font: var(--sdTypoTextNoDecorationRegularSm);
31
+ padding: 1px 0px 3px;
32
+ }
33
+
34
+ .text.base.regular {
35
+ font: var(--sdTypoTextNoDecorationRegularBase);
36
+ padding: 2px 0px;
37
+ }
38
+
39
+ .text.lg.regular {
40
+ font: var(--sdTypoTextNoDecorationRegularLg);
41
+ padding: 2px 0px;
42
+ }
43
+
44
+ .text.xl.regular {
45
+ font: var(--sdTypoTextNoDecorationRegularXl);
46
+ padding: 1px 0px 3px;
47
+ }
48
+
49
+ .text.xxl.regular {
50
+ font: var(--sdTypoTextNoDecorationRegular2xl);
51
+ padding: 0px;
52
+ }
53
+
54
+ .text.xxxl.regular {
55
+ font: var(--sdTypoTextNoDecorationRegular3xl);
56
+ padding: 1px 0px 3px;
57
+ }
58
+
59
+ .text.xxxxl.regular {
60
+ font: var(--sdTypoTextNoDecorationRegular4xl);
61
+ padding: 3px 0px 1px;
62
+ }
63
+
64
+ /* Regular Italic */
65
+
66
+ .text.xs.regular.italic {
67
+ font: var(--sdTypoTextNoDecorationItalicXs);
68
+ padding: 1px 0px 2px;
69
+ }
70
+
71
+ .text.sm.regular.italic {
72
+ font: var(--sdTypoTextNoDecorationItalicSm);
73
+ padding: 1px 0px 3px;
74
+ }
75
+
76
+ .text.base.regular.italic {
77
+ font: var(--sdTypoTextNoDecorationItalicBase);
78
+ padding: 2px 0px;
79
+ }
80
+
81
+ .text.lg.regular.italic {
82
+ font: var(--sdTypoTextNoDecorationItalicLg);
83
+ padding: 2px 0px;
84
+ }
85
+
86
+ .text.xl.regular.italic {
87
+ font: var(--sdTypoTextNoDecorationItalicXl);
88
+ padding: 1px 0px 3px;
89
+ }
90
+
91
+ .text.xxl.regular.italic {
92
+ font: var(--sdTypoTextNoDecorationItalic2xl);
93
+ padding: 0px;
94
+ }
95
+
96
+ .text.xxxl.regular.italic {
97
+ font: var(--sdTypoTextNoDecorationItalic3xl);
98
+ padding: 1px 0px 3px;
99
+ }
100
+
101
+ .text.xxxxl.regular.italic {
102
+ font: var(--sdTypoTextNoDecorationItalic4xl);
103
+ padding: 3px 0px 1px;
104
+ }
105
+
106
+ /* Bold */
107
+
108
+ .text.xs.bold {
109
+ font: var(--sdTypoTextNoDecorationBoldXs);
110
+ padding: 1px 0px 2px;
111
+ }
112
+
113
+ .text.sm.bold {
114
+ font: var(--sdTypoTextNoDecorationBoldSm);
115
+ padding: 1px 0px 3px;
116
+ }
117
+
118
+ .text.base.bold {
119
+ font: var(--sdTypoTextNoDecorationBoldBase);
120
+ padding: 2px 0px;
121
+ }
122
+
123
+ .text.lg.bold {
124
+ font: var(--sdTypoTextNoDecorationBoldLg);
125
+ padding: 2px 0px;
126
+ }
127
+
128
+ .text.xl.bold {
129
+ font: var(--sdTypoTextNoDecorationBoldXl);
130
+ padding: 1px 0px 3px;
131
+ }
132
+
133
+ .text.xxl.bold {
134
+ font: var(--sdTypoTextNoDecorationBold2xl);
135
+ padding: 0px;
136
+ }
137
+
138
+ .text.xxxl.bold {
139
+ font: var(--sdTypoTextNoDecorationBold3xl);
140
+ padding: 1px 0px 3px;
141
+ }
142
+
143
+ .text.xxxxl.bold {
144
+ font: var(--sdTypoTextNoDecorationBold4xl);
145
+ padding: 3px 0px 1px;
146
+ }
147
+
148
+ /* Bold Italic */
149
+
150
+ .text.xs.bold.italic {
151
+ font: var(--sdTypoTextNoDecorationBoldItalicXs);
152
+ padding: 1px 0px 2px;
153
+ }
154
+
155
+ .text.sm.bold.italic {
156
+ font: var(--sdTypoTextNoDecorationBoldItalicSm);
157
+ padding: 1px 0px 3px;
158
+ }
159
+
160
+ .text.base.bold.italic {
161
+ font: var(--sdTypoTextNoDecorationBoldItalicBase);
162
+ padding: 2px 0px;
163
+ }
164
+
165
+ .text.lg.bold.italic {
166
+ font: var(--sdTypoTextNoDecorationBoldItalicLg);
167
+ padding: 2px 0px;
168
+ }
169
+
170
+ .text.xl.bold.italic {
171
+ font: var(--sdTypoTextNoDecorationBoldItalicXl);
172
+ padding: 1px 0px 3px;
173
+ }
174
+
175
+ .text.xxl.bold.italic {
176
+ font: var(--sdTypoTextNoDecorationBoldItalic2xl);
177
+ padding: 0px;
178
+ }
179
+
180
+ .text.xxxl.bold.italic {
181
+ font: var(--sdTypoTextNoDecorationBoldItalic3xl);
182
+ padding: 1px 0px 3px;
183
+ }
184
+
185
+ .text.xxxxl.bold.italic {
186
+ font: var(--sdTypoTextNoDecorationBoldItalic4xl);
187
+ padding: 3px 0px 1px;
188
+ }
189
+
190
+ /* Semi Bold */
191
+
192
+ .text.xs.semi-bold {
193
+ font: var(--sdTypoTextNoDecorationSemiBoldXs);
194
+ padding: 1px 0px 2px;
195
+ }
196
+
197
+ .text.sm.semi-bold {
198
+ font: var(--sdTypoTextNoDecorationSemiBoldSm);
199
+ padding: 1px 0px 3px;
200
+ }
201
+
202
+ .text.base.semi-bold {
203
+ font: var(--sdTypoTextNoDecorationSemiBoldBase);
204
+ padding: 2px 0px;
205
+ }
206
+
207
+ .text.lg.semi-bold {
208
+ font: var(--sdTypoTextNoDecorationSemiBoldLg);
209
+ padding: 2px 0px;
210
+ }
211
+
212
+ .text.xl.semi-bold {
213
+ font: var(--sdTypoTextNoDecorationSemiBoldXl);
214
+ padding: 1px 0px 3px;
215
+ }
216
+
217
+ .text.xxl.semi-bold {
218
+ font: var(--sdTypoTextNoDecorationSemiBold2xl);
219
+ padding: 0px;
220
+ }
221
+
222
+ .text.xxxl.semi-bold {
223
+ font: var(--sdTypoTextNoDecorationSemiBold3xl);
224
+ padding: 1px 0px 3px;
225
+ }
226
+
227
+ .text.xxxxl.semi-bold {
228
+ font: var(--sdTypoTextNoDecorationSemiBold4xl);
229
+ padding: 3px 0px 1px;
230
+ }
231
+
232
+ /* Semi Bold Italic */
233
+
234
+ .text.xs.semi-bold.italic {
235
+ font: var(--sdTypoTextNoDecorationSemiBoldItalicXs);
236
+ padding: 1px 0px 2px;
237
+ }
238
+
239
+ .text.sm.semi-bold.italic {
240
+ font: var(--sdTypoTextNoDecorationSemiBoldItalicSm);
241
+ padding: 1px 0px 3px;
242
+ }
243
+
244
+ .text.base.semi-bold.italic {
245
+ font: var(--sdTypoTextNoDecorationSemiBoldItalicBase);
246
+ padding: 2px 0px;
247
+ }
248
+
249
+ .text.lg.semi-bold.italic {
250
+ font: var(--sdTypoTextNoDecorationSemiBoldItalicLg);
251
+ padding: 2px 0px;
252
+ }
253
+
254
+ .text.xl.semi-bold.italic {
255
+ font: var(--sdTypoTextNoDecorationSemiBoldItalicXl);
256
+ padding: 1px 0px 3px;
257
+ }
258
+
259
+ .text.xxl.semi-bold.italic {
260
+ font: var(--sdTypoTextNoDecorationSemiBoldItalic2xl);
261
+ padding: 0px;
262
+ }
263
+
264
+ .text.xxxl.semi-bold.italic {
265
+ font: var(--sdTypoTextNoDecorationSemiBoldItalic3xl);
266
+ padding: 1px 0px 3px;
267
+ }
268
+
269
+ .text.xxxxl.semi-bold.italic {
270
+ font: var(--sdTypoTextNoDecorationSemiBoldItalic4xl);
271
+ padding: 3px 0px 1px;
272
+ }
@@ -0,0 +1,36 @@
1
+ import React, { HTMLAttributes } from 'react';
2
+ import './Text.css';
3
+
4
+ interface TextProps extends HTMLAttributes<HTMLParagraphElement> {
5
+ /** Text display */
6
+ text: string;
7
+ color?: string;
8
+ size?: 'xs' | 'sm' | 'base' | 'lg' | 'xl' | 'xxl' | 'xxxl' | 'xxxxl';
9
+ titleWeight?: 'semi-bold' | 'bold' | 'regular';
10
+ italic?: boolean;
11
+ textDecoration?: 'underline' | 'line-through';
12
+ className?: string;
13
+ }
14
+
15
+ /** This text should be use to display basic text */
16
+ export const Text = ({
17
+ text = 'Component to use for the basic texts',
18
+ color = 'black',
19
+ size = 'base',
20
+ titleWeight = 'semi-bold',
21
+ italic = false,
22
+ textDecoration,
23
+ className,
24
+ ...props
25
+ }: TextProps) => {
26
+ return (
27
+ <p
28
+ {...props}
29
+ style={{ color: color }}
30
+ className={`text ${italic && 'italic'} ${titleWeight} ${textDecoration &&
31
+ textDecoration} ${className} ${size}`}
32
+ >
33
+ {text}
34
+ </p>
35
+ );
36
+ };
@@ -0,0 +1,29 @@
1
+ @import '../../../example/index.css';
2
+
3
+ .text {
4
+ font-family: var(--sdFontFamilyPoppins);
5
+ font-weight: var(--sdFontWeightMedium);
6
+ letter-spacing: var(--sdLetterSpacingButtons);
7
+ text-align: left;
8
+ margin: unset;
9
+ padding: 2px 0px;
10
+ }
11
+
12
+ .text.bold {
13
+ font-weight: var(--sdFontWeightSemibold);
14
+ }
15
+
16
+ .sm {
17
+ font-size: var(--sdFontSizeSm);
18
+ line-height: var(--sdLineHeight140);
19
+ }
20
+
21
+ .base {
22
+ font-size: var(--sdFontSizeBase);
23
+ line-height: var(--sdLineHeight150);
24
+ }
25
+
26
+ .lg {
27
+ font-size: var(--sdFontSizeBase);
28
+ line-height: var(--sdLineHeight150);
29
+ }
@@ -1,5 +1,6 @@
1
1
  import React, { HTMLAttributes } from 'react';
2
2
  import './TextForButton.css';
3
+ import '../../../example/index.css';
3
4
 
4
5
  interface TextForButtonProps extends HTMLAttributes<HTMLParagraphElement> {
5
6
  /** Text display in the Button component */
@@ -0,0 +1,34 @@
1
+ @import '../../../example/index.css';
2
+
3
+ .text {
4
+ font-family: var(--sdFontFamilyOpenSans);
5
+ font-weight: var(--sdFontWeightRegular);
6
+ padding: 2px 0px;
7
+ }
8
+
9
+ /* Size classNames */
10
+ .xs {
11
+ font-size: var(--sdFontSizeXs);
12
+ line-height: var(--sdLineHeight130);
13
+ letter-spacing: var(--sdLetterSpacingButtons);
14
+ }
15
+
16
+ .sm {
17
+ font-size: var(--sdFontSizeSm);
18
+ line-height: var(--sdLineHeight140);
19
+ }
20
+
21
+ .base {
22
+ font-size: var(--sdFontSizeBase);
23
+ line-height: var(--sdLineHeight150);
24
+ }
25
+
26
+ /* fontWeight classNames */
27
+
28
+ .text.bold {
29
+ font-weight: var(--sdFontWeightBold);
30
+ }
31
+
32
+ .text.bold.xs {
33
+ line-height: var(--sdLineHeight120);
34
+ }
@@ -0,0 +1,32 @@
1
+ import React, { HTMLAttributes } from 'react';
2
+ import './TextForDropDownItem.css';
3
+
4
+ interface TextForDropDownItemProps
5
+ extends HTMLAttributes<HTMLParagraphElement> {
6
+ /** Text display in the Dropdown item component */
7
+ text: string;
8
+ color?: string;
9
+ bold?: boolean;
10
+ className?: string;
11
+ size?: 'xs' | 'sm' | 'base';
12
+ }
13
+
14
+ /** This text should only be used for the dropdown items text */
15
+ export const TextForDropDownItem = ({
16
+ text = 'Text for drop down item',
17
+ color = 'black',
18
+ bold = false,
19
+ size = 'base',
20
+ className,
21
+ ...props
22
+ }: TextForDropDownItemProps) => {
23
+ return (
24
+ <p
25
+ {...props}
26
+ style={{ color: color }}
27
+ className={`text ${bold && 'bold'} ${size} ${className}`}
28
+ >
29
+ {text}
30
+ </p>
31
+ );
32
+ };
@@ -0,0 +1,76 @@
1
+ @import '../../../example/index.css';
2
+
3
+ .text {
4
+ font-family: var(--sdFontFamilyPoppins);
5
+ font-weight: var(--sdFontWeightSemibold);
6
+ letter-spacing: var(--sdLetterSpacingHeadings);
7
+ text-align: left;
8
+ margin: unset;
9
+ }
10
+
11
+ .italic {
12
+ font-style: italic;
13
+ }
14
+
15
+ /* Size classNames */
16
+ .xs {
17
+ font-size: var(--sdFontSizeSm);
18
+ line-height: var(--sdLineHeight140);
19
+ padding: 1px 0px;
20
+ }
21
+
22
+ .sm {
23
+ font-size: var(--sdFontSizeSm);
24
+ line-height: var(--sdLineHeight140);
25
+ padding: 3px 0px 1px;
26
+ }
27
+
28
+ .base {
29
+ font-size: var(--sdFontSizeBase);
30
+ line-height: var(--sdLineHeight150);
31
+ padding: 2px 0px;
32
+ }
33
+
34
+ .lg {
35
+ font-size: var(--sdFontSizeLg);
36
+ line-height: var(--sdLineHeight140);
37
+ padding: 3px 0px 1px;
38
+ }
39
+
40
+ .xl {
41
+ font-size: var(--sdFontSizeXl);
42
+ line-height: var(--sdLineHeight150);
43
+ padding: 2px 0px;
44
+ }
45
+
46
+ .xxl {
47
+ font-size: var(--sdFontSize2xl);
48
+ line-height: var(--sdLineHeight150);
49
+ padding: 1px 0px 3px;
50
+ }
51
+
52
+ .xxxl {
53
+ font-size: var(--sdFontSize3xl);
54
+ line-height: 150%;
55
+ padding: 3px 0px 1px;
56
+ }
57
+
58
+ .xxxxl {
59
+ font-size: var(--sdFontSize4xl);
60
+ line-height: var(--sdLineHeight150);
61
+ padding: 2px 0px;
62
+ }
63
+
64
+ /* fontWeight classNames */
65
+
66
+ .bold {
67
+ font-weight: var(--sdFontWeightBold);
68
+ }
69
+
70
+ .semi-bold {
71
+ font-weight: var(--sdFontWeightSemibold);
72
+ }
73
+
74
+ .regular {
75
+ font-weight: var(--sdFontWeightRegular);
76
+ }
@@ -0,0 +1,34 @@
1
+ import React, { HTMLAttributes } from 'react';
2
+ import './Title.css';
3
+
4
+ interface TitleProps extends HTMLAttributes<HTMLParagraphElement> {
5
+ /** Text display in the Title */
6
+ text: string;
7
+ color?: string;
8
+ size?: 'xs' | 'sm' | 'base' | 'lg' | 'xl' | 'xxl' | 'xxxl' | 'xxxxl';
9
+ titleWeight?: 'semi-bold' | 'bold' | 'regular';
10
+ italic?: boolean;
11
+ className?: string;
12
+ }
13
+
14
+ /** This text should only be used to display titles */
15
+ export const Title = ({
16
+ text = 'Component to use for the titles',
17
+ color = 'black',
18
+ size = 'base',
19
+ titleWeight = 'semi-bold',
20
+ italic = false,
21
+ className,
22
+ ...props
23
+ }: TitleProps) => {
24
+ return (
25
+ <p
26
+ {...props}
27
+ style={{ color: color }}
28
+ className={`text ${italic &&
29
+ 'italic'} ${titleWeight} ${className} ${size}`}
30
+ >
31
+ {text}
32
+ </p>
33
+ );
34
+ };
@@ -0,0 +1,7 @@
1
+ import { Button } from './Buttons/Button';
2
+ import { Caption } from './Typography/Caption';
3
+ import { Text } from './Typography/Text';
4
+ import { TextForButton } from './Typography/TextForButton';
5
+ import { Title } from './Typography/Title';
6
+
7
+ export { Button, Text, Caption, Title, TextForButton };
@@ -1,29 +0,0 @@
1
- .text {
2
- font-family: Poppins;
3
- font-weight: 500;
4
- letter-spacing: 0.03em;
5
- text-align: left;
6
- margin: unset;
7
- }
8
-
9
- .text.bold {
10
- font-weight: 600;
11
- }
12
-
13
- .sm {
14
- font-size: 14px;
15
- line-height: 20px;
16
- padding: 1px 0px 3px;
17
- }
18
-
19
- .base {
20
- font-size: 16px;
21
- line-height: 24px;
22
- padding: 2px 0px;
23
- }
24
-
25
- .lg {
26
- font-size: 16px;
27
- line-height: 24px;
28
- padding: 2px 0px;
29
- }
File without changes
File without changes