@dt-dds/react-icon 1.0.0-beta.42
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/CHANGELOG.md +367 -0
- package/LICENSE.md +21 -0
- package/README.md +69 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +103 -0
- package/dist/index.mjs +66 -0
- package/package.json +55 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
# @dt-ui/react-icon
|
|
2
|
+
|
|
3
|
+
## 1.0.0-beta.42
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- refactor!: rename pkg and publish to npmjs
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @dt-dds/icons@1.0.0-beta.4
|
|
13
|
+
- @dt-dds/react-core@1.0.0-beta.41
|
|
14
|
+
|
|
15
|
+
## 0.1.0-beta.41
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- refactor: drop icon funcional state
|
|
20
|
+
|
|
21
|
+
## 0.1.0-beta.40
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- refactor: theme typography values
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
- @dt-ui/react-core@0.1.0-beta.40
|
|
28
|
+
|
|
29
|
+
## 0.1.0-beta.39
|
|
30
|
+
|
|
31
|
+
### Minor Changes
|
|
32
|
+
|
|
33
|
+
- feat: update shadow theme values
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- Updated dependencies
|
|
38
|
+
- @dt-ui/react-core@0.1.0-beta.39
|
|
39
|
+
|
|
40
|
+
## 0.1.0-beta.38
|
|
41
|
+
|
|
42
|
+
### Minor Changes
|
|
43
|
+
|
|
44
|
+
- feat: add new icon font sizes
|
|
45
|
+
|
|
46
|
+
## 0.1.0-beta.37
|
|
47
|
+
|
|
48
|
+
### Patch Changes
|
|
49
|
+
|
|
50
|
+
- chore: update theme font-styles
|
|
51
|
+
- Updated dependencies
|
|
52
|
+
- @dt-ui/react-core@0.1.0-beta.38
|
|
53
|
+
|
|
54
|
+
## 0.1.0-beta.36
|
|
55
|
+
|
|
56
|
+
### Patch Changes
|
|
57
|
+
|
|
58
|
+
- chore: review OSS files
|
|
59
|
+
- Updated dependencies
|
|
60
|
+
- @dt-ui/icons@0.1.0-beta.3
|
|
61
|
+
- @dt-ui/react-core@0.1.0-beta.37
|
|
62
|
+
|
|
63
|
+
## 0.1.0-beta.35
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- chore: update contextual colors
|
|
68
|
+
- Updated dependencies
|
|
69
|
+
- @dt-ui/react-core@0.1.0-beta.36
|
|
70
|
+
|
|
71
|
+
## 0.1.0-beta.34
|
|
72
|
+
|
|
73
|
+
### Minor Changes
|
|
74
|
+
|
|
75
|
+
- feat: implement IconButton contrast and size
|
|
76
|
+
|
|
77
|
+
## 0.1.0-beta.33
|
|
78
|
+
|
|
79
|
+
### Patch Changes
|
|
80
|
+
|
|
81
|
+
- fix: change content.light contextual color
|
|
82
|
+
- Updated dependencies
|
|
83
|
+
- @dt-ui/react-core@0.1.0-beta.35
|
|
84
|
+
|
|
85
|
+
## 0.1.0-beta.32
|
|
86
|
+
|
|
87
|
+
### Minor Changes
|
|
88
|
+
|
|
89
|
+
- feat: move icon-button to independent
|
|
90
|
+
|
|
91
|
+
## 0.1.0-beta.31
|
|
92
|
+
|
|
93
|
+
### Patch Changes
|
|
94
|
+
|
|
95
|
+
- fix: add accent to colors type
|
|
96
|
+
- Updated dependencies
|
|
97
|
+
- @dt-ui/react-core@0.1.0-beta.34
|
|
98
|
+
|
|
99
|
+
## 0.1.0-beta.30
|
|
100
|
+
|
|
101
|
+
### Patch Changes
|
|
102
|
+
|
|
103
|
+
- fix: change button text according to ux
|
|
104
|
+
- Updated dependencies
|
|
105
|
+
- @dt-ui/react-core@0.1.0-beta.33
|
|
106
|
+
|
|
107
|
+
## 0.1.0-beta.29
|
|
108
|
+
|
|
109
|
+
### Patch Changes
|
|
110
|
+
|
|
111
|
+
- chore: update contexual colors
|
|
112
|
+
- Updated dependencies
|
|
113
|
+
- @dt-ui/react-core@0.1.0-beta.32
|
|
114
|
+
|
|
115
|
+
## 0.1.0-beta.28
|
|
116
|
+
|
|
117
|
+
### Patch Changes
|
|
118
|
+
|
|
119
|
+
- style: update responsive font styles
|
|
120
|
+
- Updated dependencies
|
|
121
|
+
- @dt-ui/react-core@0.1.0-beta.31
|
|
122
|
+
|
|
123
|
+
## 0.1.0-beta.27
|
|
124
|
+
|
|
125
|
+
### Minor Changes
|
|
126
|
+
|
|
127
|
+
- feat: add spinner size 'extra-small' & update specs
|
|
128
|
+
|
|
129
|
+
### Patch Changes
|
|
130
|
+
|
|
131
|
+
- Updated dependencies
|
|
132
|
+
- @dt-ui/react-core@0.1.0-beta.30
|
|
133
|
+
|
|
134
|
+
## 0.1.0-beta.26
|
|
135
|
+
|
|
136
|
+
### Patch Changes
|
|
137
|
+
|
|
138
|
+
- chore: add theme breakpoints
|
|
139
|
+
- Updated dependencies
|
|
140
|
+
- @dt-ui/react-core@0.1.0-beta.29
|
|
141
|
+
|
|
142
|
+
## 0.1.0-beta.25
|
|
143
|
+
|
|
144
|
+
### Minor Changes
|
|
145
|
+
|
|
146
|
+
- feat: add id to base props
|
|
147
|
+
|
|
148
|
+
### Patch Changes
|
|
149
|
+
|
|
150
|
+
- Updated dependencies
|
|
151
|
+
- @dt-ui/react-core@0.1.0-beta.28
|
|
152
|
+
|
|
153
|
+
## 0.1.0-beta.24
|
|
154
|
+
|
|
155
|
+
### Minor Changes
|
|
156
|
+
|
|
157
|
+
- feat: change breakpoints values
|
|
158
|
+
|
|
159
|
+
### Patch Changes
|
|
160
|
+
|
|
161
|
+
- Updated dependencies
|
|
162
|
+
- @dt-ui/react-core@0.1.0-beta.27
|
|
163
|
+
|
|
164
|
+
## 0.1.0-beta.23
|
|
165
|
+
|
|
166
|
+
### Patch Changes
|
|
167
|
+
|
|
168
|
+
- fix: replace body to correct one
|
|
169
|
+
- Updated dependencies
|
|
170
|
+
- @dt-ui/react-core@0.1.0-beta.26
|
|
171
|
+
|
|
172
|
+
## 0.1.0-beta.22
|
|
173
|
+
|
|
174
|
+
### Patch Changes
|
|
175
|
+
|
|
176
|
+
- chore: add theme colors missing types
|
|
177
|
+
- Updated dependencies
|
|
178
|
+
- @dt-ui/react-core@0.1.0-beta.25
|
|
179
|
+
|
|
180
|
+
## 0.1.0-beta.21
|
|
181
|
+
|
|
182
|
+
### Patch Changes
|
|
183
|
+
|
|
184
|
+
- refactor: drop truckapi theme
|
|
185
|
+
- Updated dependencies
|
|
186
|
+
- @dt-ui/react-core@0.1.0-beta.24
|
|
187
|
+
|
|
188
|
+
## 0.1.0-beta.20
|
|
189
|
+
|
|
190
|
+
### Minor Changes
|
|
191
|
+
|
|
192
|
+
- feat: update core and semantic colors
|
|
193
|
+
- feat: remove greenlane theme
|
|
194
|
+
|
|
195
|
+
### Patch Changes
|
|
196
|
+
|
|
197
|
+
- Updated dependencies
|
|
198
|
+
- Updated dependencies
|
|
199
|
+
- @dt-ui/react-core@0.1.0-beta.23
|
|
200
|
+
|
|
201
|
+
## 0.1.0-beta.19
|
|
202
|
+
|
|
203
|
+
### Minor Changes
|
|
204
|
+
|
|
205
|
+
- feat: add icon option for truckapi theme
|
|
206
|
+
|
|
207
|
+
### Patch Changes
|
|
208
|
+
|
|
209
|
+
- Updated dependencies
|
|
210
|
+
- @dt-ui/react-core@0.1.0-beta.22
|
|
211
|
+
|
|
212
|
+
## 0.1.0-beta.18
|
|
213
|
+
|
|
214
|
+
### Patch Changes
|
|
215
|
+
|
|
216
|
+
- fix: tooltip z index
|
|
217
|
+
- Updated dependencies
|
|
218
|
+
- @dt-ui/react-core@0.1.0-beta.21
|
|
219
|
+
|
|
220
|
+
## 0.1.0-beta.17
|
|
221
|
+
|
|
222
|
+
### Minor Changes
|
|
223
|
+
|
|
224
|
+
- feat: add segmented control component
|
|
225
|
+
|
|
226
|
+
### Patch Changes
|
|
227
|
+
|
|
228
|
+
- Updated dependencies
|
|
229
|
+
- @dt-ui/react-core@0.1.0-beta.20
|
|
230
|
+
|
|
231
|
+
## 0.1.0-beta.16
|
|
232
|
+
|
|
233
|
+
### Patch Changes
|
|
234
|
+
|
|
235
|
+
- fix: add shape for tooltip on truckapi theme
|
|
236
|
+
- Updated dependencies
|
|
237
|
+
- @dt-ui/react-core@0.1.0-beta.19
|
|
238
|
+
|
|
239
|
+
## 0.1.0-beta.15
|
|
240
|
+
|
|
241
|
+
### Patch Changes
|
|
242
|
+
|
|
243
|
+
- fix: remove devDependecy export
|
|
244
|
+
- Updated dependencies
|
|
245
|
+
- @dt-ui/react-core@0.1.0-beta.18
|
|
246
|
+
|
|
247
|
+
## 0.1.0-beta.14
|
|
248
|
+
|
|
249
|
+
### Patch Changes
|
|
250
|
+
|
|
251
|
+
- test: add test custom render
|
|
252
|
+
- Updated dependencies
|
|
253
|
+
- @dt-ui/react-core@0.1.0-beta.17
|
|
254
|
+
|
|
255
|
+
## 0.1.0-beta.13
|
|
256
|
+
|
|
257
|
+
### Minor Changes
|
|
258
|
+
|
|
259
|
+
- feat: create select
|
|
260
|
+
|
|
261
|
+
### Patch Changes
|
|
262
|
+
|
|
263
|
+
- Updated dependencies
|
|
264
|
+
- @dt-ui/react-core@0.1.0-beta.16
|
|
265
|
+
|
|
266
|
+
## 0.1.0-beta.12
|
|
267
|
+
|
|
268
|
+
### Patch Changes
|
|
269
|
+
|
|
270
|
+
- fix: show shadows only when scroll is visible
|
|
271
|
+
- Updated dependencies
|
|
272
|
+
- @dt-ui/react-core@0.1.0-beta.15
|
|
273
|
+
|
|
274
|
+
## 0.1.0-beta.11
|
|
275
|
+
|
|
276
|
+
### Patch Changes
|
|
277
|
+
|
|
278
|
+
- fix: update border radius theme specifications
|
|
279
|
+
- Updated dependencies
|
|
280
|
+
- @dt-ui/react-core@0.1.0-beta.14
|
|
281
|
+
|
|
282
|
+
## 0.1.0-beta.10
|
|
283
|
+
|
|
284
|
+
### Minor Changes
|
|
285
|
+
|
|
286
|
+
- feat: add onClick on Icon
|
|
287
|
+
|
|
288
|
+
## 0.1.0-beta.9
|
|
289
|
+
|
|
290
|
+
### Patch Changes
|
|
291
|
+
|
|
292
|
+
- fix: match accordion design
|
|
293
|
+
- Updated dependencies
|
|
294
|
+
- @dt-ui/react-core@0.1.0-beta.13
|
|
295
|
+
|
|
296
|
+
## 0.1.0-beta.8
|
|
297
|
+
|
|
298
|
+
### Patch Changes
|
|
299
|
+
|
|
300
|
+
- fix: make icons an optional property in theme
|
|
301
|
+
- Updated dependencies
|
|
302
|
+
- @dt-ui/react-core@0.1.0-beta.12
|
|
303
|
+
|
|
304
|
+
## 0.1.0-beta.7
|
|
305
|
+
|
|
306
|
+
### Patch Changes
|
|
307
|
+
|
|
308
|
+
- refactor: extract text-field to new package with greenlane theme
|
|
309
|
+
- Updated dependencies
|
|
310
|
+
- @dt-ui/react-core@0.1.0-beta.11
|
|
311
|
+
|
|
312
|
+
## 0.1.0-beta.6
|
|
313
|
+
|
|
314
|
+
### Patch Changes
|
|
315
|
+
|
|
316
|
+
- refactor: move and refactor checkbox refactor checkbox according to design
|
|
317
|
+
- Updated dependencies
|
|
318
|
+
- @dt-ui/react-core@0.1.0-beta.10
|
|
319
|
+
|
|
320
|
+
## 0.1.0-beta.5
|
|
321
|
+
|
|
322
|
+
### Patch Changes
|
|
323
|
+
|
|
324
|
+
- fix(icons): export css and update imports on deps
|
|
325
|
+
- Updated dependencies
|
|
326
|
+
- @dt-ui/icons@0.1.0-beta.2
|
|
327
|
+
- @dt-ui/react-core@0.1.0-beta.9
|
|
328
|
+
|
|
329
|
+
## 0.1.0-beta.4
|
|
330
|
+
|
|
331
|
+
### Patch Changes
|
|
332
|
+
|
|
333
|
+
- chore: update component generator and lint fixes
|
|
334
|
+
|
|
335
|
+
## 0.1.0-beta.3
|
|
336
|
+
|
|
337
|
+
### Patch Changes
|
|
338
|
+
|
|
339
|
+
- chore: move util functions to the core
|
|
340
|
+
- Updated dependencies
|
|
341
|
+
- @dt-ui/react-core@0.1.0-beta.8
|
|
342
|
+
|
|
343
|
+
## 0.1.0-beta.2
|
|
344
|
+
|
|
345
|
+
### Minor Changes
|
|
346
|
+
|
|
347
|
+
- feat: add contextual color add content tertiary to palette
|
|
348
|
+
|
|
349
|
+
### Patch Changes
|
|
350
|
+
|
|
351
|
+
- Updated dependencies
|
|
352
|
+
- @dt-ui/react-core@0.1.0-beta.7
|
|
353
|
+
|
|
354
|
+
## 0.1.0-beta.1
|
|
355
|
+
|
|
356
|
+
### Minor Changes
|
|
357
|
+
|
|
358
|
+
- feat: create Icons package
|
|
359
|
+
- feat: add icons to theme Provider
|
|
360
|
+
- feat: create react Icon component
|
|
361
|
+
|
|
362
|
+
### Patch Changes
|
|
363
|
+
|
|
364
|
+
- Updated dependencies
|
|
365
|
+
- Updated dependencies
|
|
366
|
+
- @dt-ui/icons@0.1.0-beta.1
|
|
367
|
+
- @dt-ui/react-core@0.1.0-beta.6
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Daimler Truck AG.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Icon Package
|
|
2
|
+
|
|
3
|
+
This package provides a customizable and stylized Icon component for use in React applications.
|
|
4
|
+
|
|
5
|
+
## Icon Usage
|
|
6
|
+
|
|
7
|
+
```jsx
|
|
8
|
+
import { Icon } from '@dt-dds/react-icon';
|
|
9
|
+
|
|
10
|
+
export const App = () => {
|
|
11
|
+
return <Icon code='warning' />;
|
|
12
|
+
};
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
| Property | Type | Default | Description |
|
|
18
|
+
| ------------ | ---------------------- | ---------- | ------------------------------------------------------------------------------------------ |
|
|
19
|
+
| `code` | `Code` | - | Specifies the icon code for the desired symbol. |
|
|
20
|
+
| `color` | `string` | - | Sets the color of the icon. |
|
|
21
|
+
| `size` | `Size` | 'l' | Specifies the predefined icon sizes. Custom font-sizes are allowed through the style prop. |
|
|
22
|
+
| `variant` | 'outlined' \| 'filled' | 'outlined' | Specifies the icon filling variant. |
|
|
23
|
+
| `dataTestId` | `string` | 'icon' | Customizable test identifier. |
|
|
24
|
+
| `style` | `React.CSSProperties` | - | Additional styles to apply to the icon. |
|
|
25
|
+
|
|
26
|
+
## Stack
|
|
27
|
+
|
|
28
|
+
- [TypeScript](https://www.typescriptlang.org/) for static type checking
|
|
29
|
+
- [React](https://reactjs.org/) — JavaScript library for user interfaces
|
|
30
|
+
- [Emotion](https://emotion.sh/docs/introduction) — for writing css styles with JavaScript
|
|
31
|
+
- [Storybook](https://storybook.js.org/) — UI component environment powered by Vite
|
|
32
|
+
- [Jest](https://jestjs.io/) - JavaScript Testing Framework
|
|
33
|
+
- [React Testing Library](https://testing-library.com/) - to test UI components in a user-centric way
|
|
34
|
+
- [ESLint](https://eslint.org/) for code linting
|
|
35
|
+
- [Prettier](https://prettier.io) for code formatting
|
|
36
|
+
- [Tsup](https://github.com/egoist/tsup) — TypeScript bundler powered by esbuild
|
|
37
|
+
- [Yarn](https://yarnpkg.com/) from managing packages
|
|
38
|
+
|
|
39
|
+
## Commands
|
|
40
|
+
|
|
41
|
+
- `yarn build` - Build the package
|
|
42
|
+
- `yarn dev` - Run the package locally
|
|
43
|
+
- `yarn lint` - Lint all files within this package
|
|
44
|
+
- `yarn test` - Run all unit tests
|
|
45
|
+
- `yarn test:report` - Open the test coverage report
|
|
46
|
+
- `yarn test:update:snapshot` - Run all unit tests and update the snapshot
|
|
47
|
+
|
|
48
|
+
## Compilation
|
|
49
|
+
|
|
50
|
+
Running `yarn build` from the root of the package will use [tsup](https://tsup.egoist.dev/) to compile the raw TypeScript and React code to plain JavaScript.
|
|
51
|
+
|
|
52
|
+
The `/dist` folder contains the compiled output.
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
icon
|
|
56
|
+
└── dist
|
|
57
|
+
├── index.d.ts <-- Types
|
|
58
|
+
├── index.js <-- CommonJS version
|
|
59
|
+
└── index.mjs <-- ES Modules version
|
|
60
|
+
...
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Versioning
|
|
64
|
+
|
|
65
|
+
Follows [semantic versioning](https://semver.org/)
|
|
66
|
+
|
|
67
|
+
## © License
|
|
68
|
+
|
|
69
|
+
Licensed under [MIT License](LICENSE.md)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseProps, Theme } from '@dt-dds/react-core';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { Code } from '@dt-dds/icons';
|
|
4
|
+
|
|
5
|
+
type Variant = 'outlined' | 'filled';
|
|
6
|
+
|
|
7
|
+
type Size = 'xs' | 's' | 'm' | 'l' | 'xl';
|
|
8
|
+
|
|
9
|
+
interface IconProps extends Omit<BaseProps, 'children'> {
|
|
10
|
+
code: Code;
|
|
11
|
+
color?: string;
|
|
12
|
+
size?: Size;
|
|
13
|
+
variant?: Variant;
|
|
14
|
+
}
|
|
15
|
+
declare const Icon: ({ code, color, dataTestId, size, style, variant, }: IconProps) => react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
declare module '@emotion/react' {
|
|
18
|
+
interface Theme extends Theme {
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { Icon, IconProps };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// index.ts
|
|
31
|
+
var icon_exports = {};
|
|
32
|
+
__export(icon_exports, {
|
|
33
|
+
Icon: () => Icon
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(icon_exports);
|
|
36
|
+
|
|
37
|
+
// src/Icon.tsx
|
|
38
|
+
var import_react = require("@emotion/react");
|
|
39
|
+
|
|
40
|
+
// src/Icon.styled.ts
|
|
41
|
+
var import_styled = __toESM(require("@emotion/styled"));
|
|
42
|
+
var fontSize = {
|
|
43
|
+
xs: "12px",
|
|
44
|
+
s: "16px",
|
|
45
|
+
m: "20px",
|
|
46
|
+
l: "24px",
|
|
47
|
+
xl: "32px"
|
|
48
|
+
};
|
|
49
|
+
var IconStyled = import_styled.default.i`
|
|
50
|
+
${({ size, theme, variant, color }) => `
|
|
51
|
+
font-family: DTUI-icons-${theme.icons};
|
|
52
|
+
font-weight: normal;
|
|
53
|
+
font-style: normal;
|
|
54
|
+
font-size: ${fontSize[size]};
|
|
55
|
+
display: inline-block;
|
|
56
|
+
line-height: 1;
|
|
57
|
+
text-transform: none;
|
|
58
|
+
letter-spacing: normal;
|
|
59
|
+
word-wrap: normal;
|
|
60
|
+
white-space: nowrap;
|
|
61
|
+
font-variation-settings: 'FILL' ${variant === "filled" ? 1 : 0};
|
|
62
|
+
color: ${color};
|
|
63
|
+
|
|
64
|
+
/* Support for all WebKit browsers. */
|
|
65
|
+
-webkit-font-smoothing: antialiased;
|
|
66
|
+
/* Support for Safari and Chrome. */
|
|
67
|
+
text-rendering: optimizeLegibility;
|
|
68
|
+
|
|
69
|
+
/* Support for Firefox. */
|
|
70
|
+
-moz-osx-font-smoothing: grayscale;
|
|
71
|
+
|
|
72
|
+
/* Support for IE. */
|
|
73
|
+
font-feature-settings: 'liga';
|
|
74
|
+
`}
|
|
75
|
+
`;
|
|
76
|
+
|
|
77
|
+
// src/Icon.tsx
|
|
78
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
79
|
+
var Icon = ({
|
|
80
|
+
code,
|
|
81
|
+
color,
|
|
82
|
+
dataTestId,
|
|
83
|
+
size = "l",
|
|
84
|
+
style,
|
|
85
|
+
variant = "outlined"
|
|
86
|
+
}) => {
|
|
87
|
+
const theme = (0, import_react.useTheme)();
|
|
88
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
89
|
+
IconStyled,
|
|
90
|
+
{
|
|
91
|
+
color: color != null ? color : theme.palette.content.default,
|
|
92
|
+
"data-testid": dataTestId != null ? dataTestId : "icon",
|
|
93
|
+
size,
|
|
94
|
+
style,
|
|
95
|
+
variant,
|
|
96
|
+
children: code
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
};
|
|
100
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
101
|
+
0 && (module.exports = {
|
|
102
|
+
Icon
|
|
103
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// src/Icon.tsx
|
|
2
|
+
import { useTheme } from "@emotion/react";
|
|
3
|
+
|
|
4
|
+
// src/Icon.styled.ts
|
|
5
|
+
import styled from "@emotion/styled";
|
|
6
|
+
var fontSize = {
|
|
7
|
+
xs: "12px",
|
|
8
|
+
s: "16px",
|
|
9
|
+
m: "20px",
|
|
10
|
+
l: "24px",
|
|
11
|
+
xl: "32px"
|
|
12
|
+
};
|
|
13
|
+
var IconStyled = styled.i`
|
|
14
|
+
${({ size, theme, variant, color }) => `
|
|
15
|
+
font-family: DTUI-icons-${theme.icons};
|
|
16
|
+
font-weight: normal;
|
|
17
|
+
font-style: normal;
|
|
18
|
+
font-size: ${fontSize[size]};
|
|
19
|
+
display: inline-block;
|
|
20
|
+
line-height: 1;
|
|
21
|
+
text-transform: none;
|
|
22
|
+
letter-spacing: normal;
|
|
23
|
+
word-wrap: normal;
|
|
24
|
+
white-space: nowrap;
|
|
25
|
+
font-variation-settings: 'FILL' ${variant === "filled" ? 1 : 0};
|
|
26
|
+
color: ${color};
|
|
27
|
+
|
|
28
|
+
/* Support for all WebKit browsers. */
|
|
29
|
+
-webkit-font-smoothing: antialiased;
|
|
30
|
+
/* Support for Safari and Chrome. */
|
|
31
|
+
text-rendering: optimizeLegibility;
|
|
32
|
+
|
|
33
|
+
/* Support for Firefox. */
|
|
34
|
+
-moz-osx-font-smoothing: grayscale;
|
|
35
|
+
|
|
36
|
+
/* Support for IE. */
|
|
37
|
+
font-feature-settings: 'liga';
|
|
38
|
+
`}
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
// src/Icon.tsx
|
|
42
|
+
import { jsx } from "react/jsx-runtime";
|
|
43
|
+
var Icon = ({
|
|
44
|
+
code,
|
|
45
|
+
color,
|
|
46
|
+
dataTestId,
|
|
47
|
+
size = "l",
|
|
48
|
+
style,
|
|
49
|
+
variant = "outlined"
|
|
50
|
+
}) => {
|
|
51
|
+
const theme = useTheme();
|
|
52
|
+
return /* @__PURE__ */ jsx(
|
|
53
|
+
IconStyled,
|
|
54
|
+
{
|
|
55
|
+
color: color != null ? color : theme.palette.content.default,
|
|
56
|
+
"data-testid": dataTestId != null ? dataTestId : "icon",
|
|
57
|
+
size,
|
|
58
|
+
style,
|
|
59
|
+
variant,
|
|
60
|
+
children: code
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
Icon
|
|
66
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dt-dds/react-icon",
|
|
3
|
+
"version": "1.0.0-beta.42",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./dist/index.js"
|
|
7
|
+
},
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"module": "./dist/index.mjs",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist/**"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsup",
|
|
16
|
+
"dev": "tsup --watch",
|
|
17
|
+
"lint": "eslint --cache .",
|
|
18
|
+
"test": "jest",
|
|
19
|
+
"test:report": "open ./jest-coverage/lcov-report/index.html",
|
|
20
|
+
"test:update:snapshot": "jest -u"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@dt-dds/icons": "1.0.0-beta.4",
|
|
24
|
+
"@dt-dds/react-core": "1.0.0-beta.41"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@babel/core": "^7.22.9",
|
|
28
|
+
"@babel/preset-env": "^7.22.9",
|
|
29
|
+
"@babel/preset-react": "^7.22.5",
|
|
30
|
+
"@babel/preset-typescript": "^7.23.3",
|
|
31
|
+
"@emotion/babel-plugin": "^11.11.0",
|
|
32
|
+
"@emotion/css": "^11.7.1",
|
|
33
|
+
"@emotion/jest": "^11.10.0",
|
|
34
|
+
"@emotion/react": "^11.8.2",
|
|
35
|
+
"@emotion/styled": "^11.8.1",
|
|
36
|
+
"@types/react": "^18.0.9",
|
|
37
|
+
"@types/react-dom": "^18.0.4",
|
|
38
|
+
"babel-loader": "^8.3.0",
|
|
39
|
+
"eslint-config-custom": "*",
|
|
40
|
+
"eslint-plugin-storybook": "^9.1.0",
|
|
41
|
+
"jest-config": "*",
|
|
42
|
+
"react": "^18.1.0",
|
|
43
|
+
"react-dom": "^18.2.0",
|
|
44
|
+
"tsconfig": "*",
|
|
45
|
+
"tsup": "^6.6.3",
|
|
46
|
+
"typescript": "^4.5.3"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"@emotion/css": "^11.7.1",
|
|
50
|
+
"@emotion/react": "^11.8.2",
|
|
51
|
+
"@emotion/styled": "^11.8.1",
|
|
52
|
+
"react": ">=17.0.2",
|
|
53
|
+
"react-dom": ">=17.0.2"
|
|
54
|
+
}
|
|
55
|
+
}
|