@dt-dds/react-drawer 1.0.0-beta.47

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 ADDED
@@ -0,0 +1,447 @@
1
+ # @dt-ui/react-drawer
2
+
3
+ ## 1.0.0-beta.47
4
+
5
+ ### Major Changes
6
+
7
+ - refactor!: rename pkg and publish to npmjs
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @dt-dds/react-core@1.0.0-beta.41
13
+ - @dt-dds/react-icon-button@1.0.0-beta.9
14
+ - @dt-dds/react-typography@1.0.0-beta.32
15
+
16
+ ## 0.1.0-beta.46
17
+
18
+ ### Patch Changes
19
+
20
+ - refactor: theme typography values
21
+ - Updated dependencies
22
+ - @dt-ui/react-core@0.1.0-beta.40
23
+ - @dt-ui/react-icon-button@0.1.0-beta.8
24
+ - @dt-ui/react-typography@0.1.0-beta.31
25
+
26
+ ## 0.1.0-beta.45
27
+
28
+ ### Minor Changes
29
+
30
+ - feat: update shadow theme values
31
+
32
+ ### Patch Changes
33
+
34
+ - Updated dependencies
35
+ - @dt-ui/react-core@0.1.0-beta.39
36
+ - @dt-ui/react-icon-button@0.1.0-beta.7
37
+ - @dt-ui/react-typography@0.1.0-beta.30
38
+
39
+ ## 0.1.0-beta.44
40
+
41
+ ### Patch Changes
42
+
43
+ - chore: update theme font-styles
44
+ - Updated dependencies
45
+ - @dt-ui/react-core@0.1.0-beta.38
46
+ - @dt-ui/react-icon-button@0.1.0-beta.6
47
+ - @dt-ui/react-typography@0.1.0-beta.29
48
+
49
+ ## 0.1.0-beta.43
50
+
51
+ ### Patch Changes
52
+
53
+ - chore: review OSS files
54
+ - Updated dependencies
55
+ - @dt-ui/react-core@0.1.0-beta.37
56
+ - @dt-ui/react-icon-button@0.1.0-beta.5
57
+ - @dt-ui/react-typography@0.1.0-beta.28
58
+
59
+ ## 0.1.0-beta.42
60
+
61
+ ### Patch Changes
62
+
63
+ - chore: update contextual colors
64
+ - Updated dependencies
65
+ - @dt-ui/react-core@0.1.0-beta.36
66
+ - @dt-ui/react-icon-button@0.1.0-beta.4
67
+ - @dt-ui/react-typography@0.1.0-beta.27
68
+
69
+ ## 0.1.0-beta.41
70
+
71
+ ### Minor Changes
72
+
73
+ - feat: implement IconButton contrast and size
74
+
75
+ ### Patch Changes
76
+
77
+ - Updated dependencies
78
+ - @dt-ui/react-icon-button@0.1.0-beta.3
79
+
80
+ ## 0.1.0-beta.40
81
+
82
+ ### Patch Changes
83
+
84
+ - fix: circular dependencies
85
+
86
+ ## 0.1.0-beta.39
87
+
88
+ ### Patch Changes
89
+
90
+ - fix: change content.light contextual color
91
+ - Updated dependencies
92
+ - @dt-ui/react-core@0.1.0-beta.35
93
+ - @dt-ui/react-typography@0.1.0-beta.26
94
+
95
+ ## 0.1.0-beta.38
96
+
97
+ ### Minor Changes
98
+
99
+ - feat: move icon-button to independent
100
+
101
+ ## 0.1.0-beta.37
102
+
103
+ ### Patch Changes
104
+
105
+ - fix: add accent to colors type
106
+ - Updated dependencies
107
+ - @dt-ui/react-core@0.1.0-beta.34
108
+ - @dt-ui/react-typography@0.1.0-beta.25
109
+
110
+ ## 0.1.0-beta.36
111
+
112
+ ### Patch Changes
113
+
114
+ - fix: change button text according to ux
115
+ - Updated dependencies
116
+ - @dt-ui/react-core@0.1.0-beta.33
117
+ - @dt-ui/react-typography@0.1.0-beta.24
118
+
119
+ ## 0.1.0-beta.35
120
+
121
+ ### Patch Changes
122
+
123
+ - chore: update contexual colors
124
+ - Updated dependencies
125
+ - @dt-ui/react-core@0.1.0-beta.32
126
+ - @dt-ui/react-typography@0.1.0-beta.23
127
+
128
+ ## 0.1.0-beta.34
129
+
130
+ ### Patch Changes
131
+
132
+ - style: update responsive font styles
133
+ - Updated dependencies
134
+ - @dt-ui/react-core@0.1.0-beta.31
135
+ - @dt-ui/react-typography@0.1.0-beta.22
136
+
137
+ ## 0.1.0-beta.33
138
+
139
+ ### Minor Changes
140
+
141
+ - feat: add spinner size 'extra-small' & update specs
142
+
143
+ ### Patch Changes
144
+
145
+ - Updated dependencies
146
+ - @dt-ui/react-core@0.1.0-beta.30
147
+ - @dt-ui/react-typography@0.1.0-beta.21
148
+
149
+ ## 0.1.0-beta.32
150
+
151
+ ### Patch Changes
152
+
153
+ - chore: add theme breakpoints
154
+ - Updated dependencies
155
+ - @dt-ui/react-core@0.1.0-beta.29
156
+ - @dt-ui/react-typography@0.1.0-beta.20
157
+
158
+ ## 0.1.0-beta.31
159
+
160
+ ### Minor Changes
161
+
162
+ - feat: add id to base props
163
+
164
+ ### Patch Changes
165
+
166
+ - Updated dependencies
167
+ - @dt-ui/react-core@0.1.0-beta.28
168
+ - @dt-ui/react-typography@0.1.0-beta.19
169
+
170
+ ## 0.1.0-beta.30
171
+
172
+ ### Minor Changes
173
+
174
+ - feat: change breakpoints values
175
+
176
+ ### Patch Changes
177
+
178
+ - Updated dependencies
179
+ - @dt-ui/react-core@0.1.0-beta.27
180
+ - @dt-ui/react-typography@0.1.0-beta.18
181
+
182
+ ## 0.1.0-beta.29
183
+
184
+ ### Patch Changes
185
+
186
+ - fix: replace body to correct one
187
+ - Updated dependencies
188
+ - @dt-ui/react-core@0.1.0-beta.26
189
+ - @dt-ui/react-typography@0.1.0-beta.17
190
+
191
+ ## 0.1.0-beta.28
192
+
193
+ ### Patch Changes
194
+
195
+ - chore: add theme colors missing types
196
+ - Updated dependencies
197
+ - @dt-ui/react-core@0.1.0-beta.25
198
+ - @dt-ui/react-typography@0.1.0-beta.16
199
+
200
+ ## 0.1.0-beta.27
201
+
202
+ ### Patch Changes
203
+
204
+ - refactor: drop truckapi theme
205
+ - Updated dependencies
206
+ - @dt-ui/react-core@0.1.0-beta.24
207
+ - @dt-ui/react-typography@0.1.0-beta.15
208
+
209
+ ## 0.1.0-beta.26
210
+
211
+ ### Minor Changes
212
+
213
+ - feat: update core and semantic colors
214
+ - feat: remove greenlane theme
215
+
216
+ ### Patch Changes
217
+
218
+ - Updated dependencies
219
+ - Updated dependencies
220
+ - @dt-ui/react-core@0.1.0-beta.23
221
+ - @dt-ui/react-typography@0.1.0-beta.14
222
+
223
+ ## 0.1.0-beta.25
224
+
225
+ ### Patch Changes
226
+
227
+ - fix: drawerbody protect ref variable
228
+
229
+ ## 0.1.0-beta.24
230
+
231
+ ### Minor Changes
232
+
233
+ - feat: add icon option for truckapi theme
234
+
235
+ ### Patch Changes
236
+
237
+ - Updated dependencies
238
+ - @dt-ui/react-core@0.1.0-beta.22
239
+ - @dt-ui/react-typography@0.1.0-beta.13
240
+
241
+ ## 0.1.0-beta.23
242
+
243
+ ### Patch Changes
244
+
245
+ - fix: tooltip z index
246
+ - Updated dependencies
247
+ - @dt-ui/react-core@0.1.0-beta.21
248
+ - @dt-ui/react-typography@0.1.0-beta.12
249
+
250
+ ## 0.1.0-beta.22
251
+
252
+ ### Minor Changes
253
+
254
+ - feat: add segmented control component
255
+
256
+ ### Patch Changes
257
+
258
+ - Updated dependencies
259
+ - @dt-ui/react-core@0.1.0-beta.20
260
+ - @dt-ui/react-typography@0.1.0-beta.11
261
+
262
+ ## 0.1.0-beta.21
263
+
264
+ ### Patch Changes
265
+
266
+ - fix: add shape for tooltip on truckapi theme
267
+ - Updated dependencies
268
+ - @dt-ui/react-core@0.1.0-beta.19
269
+ - @dt-ui/react-typography@0.1.0-beta.10
270
+
271
+ ## 0.1.0-beta.20
272
+
273
+ ### Patch Changes
274
+
275
+ - fix: remove devDependecy export
276
+ - Updated dependencies
277
+ - @dt-ui/react-core@0.1.0-beta.18
278
+ - @dt-ui/react-typography@0.1.0-beta.9
279
+
280
+ ## 0.1.0-beta.19
281
+
282
+ ### Patch Changes
283
+
284
+ - test: add test custom render
285
+ - Updated dependencies
286
+ - @dt-ui/react-core@0.1.0-beta.17
287
+ - @dt-ui/react-typography@0.1.0-beta.8
288
+
289
+ ## 0.1.0-beta.18
290
+
291
+ ### Minor Changes
292
+
293
+ - feat: create select
294
+
295
+ ### Patch Changes
296
+
297
+ - Updated dependencies
298
+ - @dt-ui/react-core@0.1.0-beta.16
299
+ - @dt-ui/react-typography@0.1.0-beta.7
300
+
301
+ ## 0.1.0-beta.17
302
+
303
+ ### Patch Changes
304
+
305
+ - fix: show shadows only when scroll is visible
306
+ - Updated dependencies
307
+ - @dt-ui/react-core@0.1.0-beta.15
308
+ - @dt-ui/react-typography@0.1.0-beta.6
309
+
310
+ ## 0.1.0-beta.16
311
+
312
+ ### Patch Changes
313
+
314
+ - fix: update border radius theme specifications
315
+ - Updated dependencies
316
+ - @dt-ui/react-core@0.1.0-beta.14
317
+ - @dt-ui/react-typography@0.1.0-beta.5
318
+
319
+ ## 0.1.0-beta.15
320
+
321
+ ### Patch Changes
322
+
323
+ - refactor: apply correct drawer styles as specified
324
+
325
+ ## 0.1.0-beta.14
326
+
327
+ ### Patch Changes
328
+
329
+ - fix: match accordion design
330
+ - Updated dependencies
331
+ - @dt-ui/react-core@0.1.0-beta.13
332
+ - @dt-ui/react-typography@0.1.0-beta.4
333
+
334
+ ## 0.1.0-beta.13
335
+
336
+ ### Patch Changes
337
+
338
+ - fix: make icons an optional property in theme
339
+ - Updated dependencies
340
+ - @dt-ui/react-core@0.1.0-beta.12
341
+ - @dt-ui/react-typography@0.1.0-beta.3
342
+
343
+ ## 0.1.0-beta.12
344
+
345
+ ### Patch Changes
346
+
347
+ - refactor: extract text-field to new package with greenlane theme
348
+ - Updated dependencies
349
+ - @dt-ui/react-core@0.1.0-beta.11
350
+ - @dt-ui/react-typography@0.1.0-beta.2
351
+
352
+ ## 0.1.0-beta.11
353
+
354
+ ### Patch Changes
355
+
356
+ - chore: make Typography component independent
357
+ - Updated dependencies
358
+ - @dt-ui/react-typography@0.1.0-beta.1
359
+
360
+ ## 0.1.0-beta.10
361
+
362
+ ### Patch Changes
363
+
364
+ - refactor: move and refactor checkbox refactor checkbox according to design
365
+ - Updated dependencies
366
+ - @dt-ui/react-core@0.1.0-beta.10
367
+
368
+ ## 0.1.0-beta.9
369
+
370
+ ### Patch Changes
371
+
372
+ - fix(icons): export css and update imports on deps
373
+ - Updated dependencies
374
+ - @dt-ui/react-core@0.1.0-beta.9
375
+
376
+ ## 0.1.0-beta.8
377
+
378
+ ### Patch Changes
379
+
380
+ - chore: update component generator and lint fixes
381
+
382
+ ## 0.1.0-beta.7
383
+
384
+ ### Patch Changes
385
+
386
+ - chore: move util functions to the core
387
+ - Updated dependencies
388
+ - @dt-ui/react-core@0.1.0-beta.8
389
+
390
+ ## 0.1.0-beta.6
391
+
392
+ ### Minor Changes
393
+
394
+ - feat: add contextual color add content tertiary to palette
395
+
396
+ ### Patch Changes
397
+
398
+ - Updated dependencies
399
+ - @dt-ui/react-core@0.1.0-beta.7
400
+
401
+ ## 0.1.0-beta.5
402
+
403
+ ### Minor Changes
404
+
405
+ - feat: create Icons package
406
+ - feat: add icons to theme Provider
407
+
408
+ ### Patch Changes
409
+
410
+ - Updated dependencies
411
+ - Updated dependencies
412
+ - @dt-ui/react-core@0.1.0-beta.6
413
+
414
+ ## 0.1.0-beta.4
415
+
416
+ ### Minor Changes
417
+
418
+ - feat: create TruckAPI theme and update default
419
+
420
+ ### Patch Changes
421
+
422
+ - Updated dependencies
423
+ - @dt-ui/react-core@0.1.0-beta.5
424
+
425
+ ## 0.1.0-beta.3
426
+
427
+ ### Minor Changes
428
+
429
+ - feat: update contextual color to follow figma spec
430
+
431
+ ### Patch Changes
432
+
433
+ - Updated dependencies
434
+ - @dt-ui/react-core@0.1.0-beta.4
435
+
436
+ ## 0.1.0-beta.2
437
+
438
+ ### Patch Changes
439
+
440
+ - fix: icon button import
441
+
442
+ ## 0.1.0-beta.1
443
+
444
+ ### Patch Changes
445
+
446
+ - fix: drawer close button
447
+ - chore: transform drawer in independent pkg
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,111 @@
1
+ # Drawer Package
2
+
3
+ A drawer is a component that slides in from the side of the screen. It is typically used to display additional content, such as a detail view or a list of options.
4
+
5
+ ## Usage
6
+
7
+ ```jsx
8
+ import { Drawer } from '@dt-dds/react';
9
+
10
+ export const App = () => {
11
+ const [isDrawerVisible, setIsDrawerVisible] = useState(props.isVisible);
12
+
13
+ const toggleDrawer = () => {
14
+ setIsDrawerVisible((prevState) => !prevState);
15
+ };
16
+
17
+ return (
18
+ <>
19
+ <button onClick={toggleDrawer} type='button'>
20
+ Open Drawer
21
+ </button>
22
+
23
+ <Drawer isVisible={isDrawerVisible} setIsVisible={setIsDrawerVisible}>
24
+ <Drawer.Header>
25
+ <Drawer.Title title='Drawer title' />
26
+ <div>Drawer header content here.</div>
27
+ </Drawer.Header>
28
+ <Drawer.Body>
29
+ <div>Drawer body content here.</div>
30
+ </Drawer.Body>
31
+ </Drawer>
32
+ </>
33
+ );
34
+ };
35
+ ```
36
+
37
+ ## API
38
+
39
+ ### Drawer
40
+
41
+ | Property | Type | Default | Description |
42
+ | -------------- | ----------- | ------- | ---------------------------------------------------------------------------- |
43
+ | `isVisible` | `boolean` | false | State function boolean value to define if the drawer is being shown or not |
44
+ | `setIsVisible` | `function` | - | State function set to handle the drawer open and close via its boolean value |
45
+ | `children` | `ReactNode` | - | Child component to be rendered on the drawer body |
46
+ | `dataTestId` | `string` | drawer | Drawer test identifier |
47
+
48
+ ### Drawer.Title
49
+
50
+ | Property | Type | Default | Description |
51
+ | -------- | -------- | ------- | ------------------------ |
52
+ | `title` | `string` | - | Defines the drawer title |
53
+
54
+ ### Drawer.Header
55
+
56
+ A Drawer header displays header content and includes a close button. It should wrap the `Drawer.Title`.
57
+
58
+ | Property | Type | Default | Description |
59
+ | ---------- | ----------- | ------- | ------------------------------- |
60
+ | `children` | `ReactNode` | - | Child components to be rendered |
61
+
62
+ ### Drawer.Body
63
+
64
+ | Property | Type | Default | Description |
65
+ | ---------- | ----------- | ------- | ------------------------------- |
66
+ | `children` | `ReactNode` | - | Child components to be rendered |
67
+
68
+ ## Stack
69
+
70
+ - [TypeScript](https://www.typescriptlang.org/) for static type checking
71
+ - [React](https://reactjs.org/) — JavaScript library for user interfaces
72
+ - [Emotion](https://emotion.sh/docs/introduction) — for writing css styles with JavaScript
73
+ - [Storybook](https://storybook.js.org/) — UI component environment powered by Vite
74
+ - [Jest](https://jestjs.io/) - JavaScript Testing Framework
75
+ - [React Testing Library](https://testing-library.com/) - to test UI components in a user-centric way
76
+ - [ESLint](https://eslint.org/) for code linting
77
+ - [Prettier](https://prettier.io) for code formatting
78
+ - [Tsup](https://github.com/egoist/tsup) — TypeScript bundler powered by esbuild
79
+ - [Yarn](https://yarnpkg.com/) from managing packages
80
+
81
+ ## Commands
82
+
83
+ - `yarn build` - Build the package
84
+ - `yarn dev` - Run the package locally
85
+ - `yarn lint` - Lint all files within this package
86
+ - `yarn test` - Run all unit tests
87
+ - `yarn test:report` - Open the test coverage report
88
+ - `yarn test:update:snapshot` - Run all unit tests and update the snapshot
89
+
90
+ ## Compilation
91
+
92
+ 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.
93
+
94
+ The `/dist` folder contains the compiled output.
95
+
96
+ ```bash
97
+ drawer
98
+ └── dist
99
+ ├── index.d.ts <-- Types
100
+ ├── index.js <-- CommonJS version
101
+ └── index.mjs <-- ES Modules version
102
+ ...
103
+ ```
104
+
105
+ ## Versioning
106
+
107
+ Follows [semantic versioning](https://semver.org/)
108
+
109
+ ## &copy; License
110
+
111
+ Licensed under [MIT License](LICENSE.md)
@@ -0,0 +1,29 @@
1
+ import * as _dt_dds_react_core from '@dt-dds/react-core';
2
+ import { BaseProps, Theme } from '@dt-dds/react-core';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+ import react from 'react';
5
+
6
+ interface DrawerTitleProps {
7
+ title: string;
8
+ }
9
+
10
+ interface DrawerBaseProps extends BaseProps {
11
+ isVisible: boolean;
12
+ }
13
+
14
+ interface DrawerProps extends DrawerBaseProps {
15
+ setIsVisible: react.Dispatch<react.SetStateAction<boolean>>;
16
+ }
17
+ declare const Drawer: {
18
+ ({ isVisible, setIsVisible, children, dataTestId, }: DrawerProps): react_jsx_runtime.JSX.Element;
19
+ Title: ({ title }: DrawerTitleProps) => react_jsx_runtime.JSX.Element;
20
+ Header: ({ children }: _dt_dds_react_core.BaseProps) => react_jsx_runtime.JSX.Element;
21
+ Body: ({ children, style, dataTestId }: _dt_dds_react_core.BaseProps) => react_jsx_runtime.JSX.Element;
22
+ };
23
+
24
+ declare module '@emotion/react' {
25
+ interface Theme extends Theme {
26
+ }
27
+ }
28
+
29
+ export { Drawer };