@carbon-labs/react-animated-header 0.22.0 → 0.24.0

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.
Files changed (38) hide show
  1. package/es/__stories__/AnimatedHeader.stories.d.ts +198 -332
  2. package/es/__stories__/data/index.d.ts +21 -0
  3. package/es/components/AnimatedHeader/AnimatedHeader.d.ts +9 -0
  4. package/es/components/AnimatedHeader/AnimatedHeader.js +30 -22
  5. package/es/components/HeaderTitle/HeaderTitle.d.ts +18 -0
  6. package/es/components/HeaderTitle/HeaderTitle.js +53 -0
  7. package/es/components/TasksController/TasksController.d.ts +1 -0
  8. package/es/components/TasksController/TasksController.js +2 -1
  9. package/es/components/Tiles/AIPromptTile/AIPromptTile.d.ts +1 -0
  10. package/es/components/Tiles/AIPromptTile/AIPromptTile.js +4 -1
  11. package/es/components/Tiles/BaseTile/BaseTile.d.ts +1 -0
  12. package/es/components/Tiles/GlassTile/GlassTile.d.ts +1 -0
  13. package/es/components/Tiles/GlassTile/GlassTile.js +9 -2
  14. package/es/components/WorkspaceSelector/WorkspaceSelector.d.ts +1 -0
  15. package/es/components/WorkspaceSelector/WorkspaceSelector.js +1 -0
  16. package/es/index.d.ts +3 -2
  17. package/es/index.js +1 -0
  18. package/lib/__stories__/AnimatedHeader.stories.d.ts +198 -332
  19. package/lib/__stories__/data/index.d.ts +21 -0
  20. package/lib/components/AnimatedHeader/AnimatedHeader.d.ts +9 -0
  21. package/lib/components/AnimatedHeader/AnimatedHeader.js +29 -21
  22. package/lib/components/HeaderTitle/HeaderTitle.d.ts +18 -0
  23. package/lib/components/HeaderTitle/HeaderTitle.js +57 -0
  24. package/lib/components/TasksController/TasksController.d.ts +1 -0
  25. package/lib/components/TasksController/TasksController.js +2 -1
  26. package/lib/components/Tiles/AIPromptTile/AIPromptTile.d.ts +1 -0
  27. package/lib/components/Tiles/AIPromptTile/AIPromptTile.js +4 -1
  28. package/lib/components/Tiles/BaseTile/BaseTile.d.ts +1 -0
  29. package/lib/components/Tiles/GlassTile/GlassTile.d.ts +1 -0
  30. package/lib/components/Tiles/GlassTile/GlassTile.js +9 -2
  31. package/lib/components/WorkspaceSelector/WorkspaceSelector.d.ts +1 -0
  32. package/lib/components/WorkspaceSelector/WorkspaceSelector.js +1 -0
  33. package/lib/index.d.ts +3 -2
  34. package/lib/index.js +2 -0
  35. package/package.json +2 -2
  36. package/scss/AnimatedHeader/animated-header.scss +20 -113
  37. package/scss/HeaderTitle/header-title.scss +60 -0
  38. package/scss/animated-header.scss +1 -0
@@ -137,53 +137,6 @@ body {
137
137
  background: linear-gradient(0deg, #262626bf 0%, transparent 100%);
138
138
  }
139
139
 
140
- .#{$prefix}__heading {
141
- @include type-style('heading-05');
142
-
143
- position: relative;
144
- z-index: 2;
145
- overflow: hidden;
146
- margin: $spacing-08 0 $spacing-05 0;
147
- text-overflow: ellipsis;
148
- transition: font-size 500ms motion.motion(standard, expressive),
149
- margin 500ms motion.motion(standard, expressive);
150
- white-space: nowrap;
151
-
152
- @supports (-webkit-line-clamp: 3) {
153
- display: -webkit-box;
154
- overflow: hidden;
155
- -webkit-box-orient: vertical;
156
- -webkit-line-clamp: 3;
157
- text-overflow: ellipsis;
158
- white-space: initial;
159
- }
160
- }
161
-
162
- /* support for Safari */
163
- @supports (font: -apple-system-body) and (-webkit-appearance: none) {
164
- .#{$prefix}__heading {
165
- transition: margin 500ms motion.motion(standard, expressive);
166
- }
167
- }
168
-
169
- .#{$prefix}__heading--collapsed {
170
- @include type-style('heading-03');
171
-
172
- margin: $spacing-03 0 $spacing-04 0;
173
- line-height: 1.25;
174
- }
175
-
176
- .#{$prefix}__heading-welcome {
177
- animation: 250ms ease-in fade-in;
178
- animation-fill-mode: both;
179
- }
180
-
181
- .#{$prefix}__heading-name {
182
- animation: 250ms ease-in fade-in;
183
- animation-delay: 125ms;
184
- animation-fill-mode: both;
185
- }
186
-
187
140
  .#{$prefix}__left-area-container {
188
141
  z-index: 3;
189
142
  display: flex;
@@ -276,11 +229,13 @@ body {
276
229
  display: flex;
277
230
  flex-direction: column;
278
231
  margin: 0;
232
+ margin-block-start: $spacing-08;
279
233
  opacity: 1;
280
234
  transition: opacity 500ms linear;
281
235
  }
282
236
 
283
237
  .#{$prefix}__workspace--container {
238
+ margin-block-start: calc(-1 * $spacing-08);
284
239
  min-block-size: $spacing-08;
285
240
  opacity: 1;
286
241
  transition: opacity 500ms linear;
@@ -482,42 +437,22 @@ body {
482
437
  margin-block-start: $spacing-06;
483
438
  }
484
439
 
485
- .#{$prefix}__button-collapse--container .cds--popover-container {
486
- display: flex;
487
- }
488
-
489
- .#{$prefix}__tiles-container:has(> :last-child:nth-child(1))
490
- > .#{$prefix}__tile {
491
- inline-size: calc(50% - 16px);
492
- }
493
-
494
- .#{$prefix}__tiles-container:has(> :last-child:nth-child(2))
495
- > .#{$prefix}__tile {
496
- inline-size: calc(50% - 16px);
440
+ .#{$prefix}__workspace--container {
441
+ margin-block-start: 0;
497
442
  }
498
443
 
499
- .#{$prefix}__tiles-container:has(> :last-child:nth-child(3))
500
- > .#{$prefix}__tile {
501
- inline-size: calc(50% - 16px);
444
+ .#{$prefix}__button-collapse--container .cds--popover-container {
445
+ display: flex;
502
446
  }
503
447
 
504
- .#{$prefix}__tiles-container:has(> :last-child:nth-child(4))
505
- > .#{$prefix}__tile {
448
+ .#{$prefix}__tiles-container > .#{$prefix}__tile {
506
449
  inline-size: calc(50% - 16px);
507
450
  }
508
451
 
509
- .#{$prefix}__tiles-container:has(> :nth-child(4)) > .#{$prefix}__tile {
510
- inline-size: calc(33% - 16px);
511
- }
512
-
513
452
  .#{$prefix}__tiles-container:has(> :first-child)
514
453
  > ##{$prefix}__ai-prompt-tile {
515
454
  inline-size: calc(100% - 16px);
516
455
  }
517
-
518
- .#{$prefix}__tiles-container > ##{$prefix}__ai-prompt-tile {
519
- flex-grow: 0.5;
520
- }
521
456
  }
522
457
 
523
458
  // Large
@@ -535,30 +470,18 @@ body {
535
470
  }
536
471
 
537
472
  .#{$prefix}__content {
538
- margin-block-start: 0;
473
+ margin-block-start: $spacing-08;
539
474
  }
540
475
 
541
- .#{$prefix}__tiles-container:has(> :last-child:nth-child(1))
542
- > .#{$prefix}__tile {
543
- inline-size: calc(33% - 16px);
476
+ .#{$prefix}__workspace--container {
477
+ margin-block-start: calc(-1 * $spacing-08);
544
478
  }
545
479
 
546
- .#{$prefix}__tiles-container:has(> :last-child:nth-child(2))
547
- > .#{$prefix}__tile {
548
- inline-size: calc(50% - 16px);
549
- }
550
-
551
- .#{$prefix}__tiles-container:has(> :last-child:nth-child(3))
552
- > .#{$prefix}__tile {
553
- inline-size: calc(50% - 16px);
554
- }
555
-
556
- .#{$prefix}__tiles-container:has(> :last-child:nth-child(4))
557
- > .#{$prefix}__tile {
480
+ .#{$prefix}__tiles-container > .#{$prefix}__tile {
558
481
  inline-size: calc(33% - 16px);
559
482
  }
560
483
 
561
- .#{$prefix}__tiles-container:has(> :nth-child(4)) > .#{$prefix}__tile {
484
+ .#{$prefix}__tiles-container:has(> :nth-child(5)) > .#{$prefix}__tile {
562
485
  inline-size: calc(33% - 16px);
563
486
  }
564
487
 
@@ -584,27 +507,11 @@ body {
584
507
  background-size: 89% auto;
585
508
  }
586
509
 
587
- .#{$prefix}__tiles-container:has(> :last-child:nth-child(1))
588
- > .#{$prefix}__tile {
510
+ .#{$prefix}__tiles-container > .#{$prefix}__tile {
589
511
  inline-size: calc(25% - 16px);
590
512
  }
591
513
 
592
- .#{$prefix}__tiles-container:has(> :last-child:nth-child(2))
593
- > .#{$prefix}__tile {
594
- inline-size: calc(50% - 16px);
595
- }
596
-
597
- .#{$prefix}__tiles-container:has(> :last-child:nth-child(3))
598
- > .#{$prefix}__tile {
599
- inline-size: calc(33% - 16px);
600
- }
601
-
602
- .#{$prefix}__tiles-container:has(> :last-child:nth-child(4))
603
- > .#{$prefix}__tile {
604
- inline-size: calc(25% - 16px);
605
- }
606
-
607
- .#{$prefix}__tiles-container:has(> :nth-child(4)) > .#{$prefix}__tile {
514
+ .#{$prefix}__tiles-container:has(> :nth-child(5)) > .#{$prefix}__tile {
608
515
  inline-size: calc(25% - 16px);
609
516
  }
610
517
 
@@ -643,21 +550,21 @@ body {
643
550
  }
644
551
 
645
552
  /*
646
- If the user has expressed their preference for
647
- reduced motion, then don't use animations
648
- */
553
+ If the user has expressed their preference for
554
+ reduced motion, then don't use animations
555
+ */
649
556
  @media (prefers-reduced-motion: reduce) {
650
557
  .#{$prefix},
651
558
  .#{$prefix}__static,
652
- .#{$prefix}__heading,
559
+ .#{$prefix}__title,
653
560
  .#{$prefix}__left-area-container,
654
561
  .#{$prefix}__content,
655
562
  .#{$prefix}__lottie-animation {
656
563
  transition: none;
657
564
  }
658
565
 
659
- .#{$prefix}__heading-welcome,
660
- .#{$prefix}__heading-name,
566
+ .#{$prefix}__title-first,
567
+ .#{$prefix}__title-second,
661
568
  .#{$prefix}__description,
662
569
  .#{$prefix}__button,
663
570
  .#{$prefix}__workspace,
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright IBM Corp. 2025
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ @use '@carbon/styles/scss/spacing' as *;
10
+ @use '@carbon/styles/scss/type' as *;
11
+ @use '@carbon/motion';
12
+
13
+ $prefix: 'clabs--animated-header__title' !default;
14
+
15
+ .#{$prefix} {
16
+ @include type-style('heading-05');
17
+
18
+ position: relative;
19
+ z-index: 2;
20
+ overflow: hidden;
21
+ margin: $spacing-08 0 $spacing-05 0;
22
+ text-overflow: ellipsis;
23
+ transition: font-size 500ms motion.motion(standard, expressive),
24
+ margin 500ms motion.motion(standard, expressive);
25
+ white-space: nowrap;
26
+
27
+ @supports (-webkit-line-clamp: 3) {
28
+ display: -webkit-box;
29
+ overflow: hidden;
30
+ -webkit-box-orient: vertical;
31
+ -webkit-line-clamp: 3;
32
+ text-overflow: ellipsis;
33
+ white-space: initial;
34
+ }
35
+ }
36
+
37
+ /* support for Safari */
38
+ @supports (font: -apple-system-body) and (-webkit-appearance: none) {
39
+ .#{$prefix} {
40
+ transition: margin 500ms motion.motion(standard, expressive);
41
+ }
42
+ }
43
+
44
+ .#{$prefix}-collapsed {
45
+ @include type-style('heading-03');
46
+
47
+ margin: $spacing-03 0 $spacing-04 0;
48
+ line-height: 1.25;
49
+ }
50
+
51
+ .#{$prefix}-first {
52
+ animation: 250ms ease-in fade-in;
53
+ animation-fill-mode: both;
54
+ }
55
+
56
+ .#{$prefix}-second {
57
+ animation: 250ms ease-in fade-in;
58
+ animation-delay: 125ms;
59
+ animation-fill-mode: both;
60
+ }
@@ -6,5 +6,6 @@
6
6
  */
7
7
 
8
8
  @use 'AnimatedHeader/animated-header.scss';
9
+ @use 'HeaderTitle/header-title.scss';
9
10
  @use 'Tiles/AIPromptTile/ai-prompt-tile.scss';
10
11
  @use 'Tiles/GlassTile/glass-tile.scss';