@aws-amplify/ui 6.6.2 → 6.6.4
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/dist/esm/index.mjs +4 -2
- package/dist/esm/theme/createTheme/constants.mjs +8 -0
- package/dist/esm/theme/createTheme/resolveObject.mjs +133 -0
- package/dist/esm/theme/createTheme/utils.mjs +2 -30
- package/dist/esm/theme/tokens/components/aiConversation.mjs +65 -0
- package/dist/esm/theme/tokens/components/index.mjs +2 -0
- package/dist/esm/utils/references.mjs +70 -0
- package/dist/esm/utils/utils.mjs +18 -1
- package/dist/index.js +288 -29
- package/dist/styles/AIConversation.css +59 -38
- package/dist/styles/AIConversation.layer.css +59 -38
- package/dist/styles/base.css +35 -0
- package/dist/styles/base.layer.css +35 -0
- package/dist/styles.css +94 -38
- package/dist/styles.layer.css +94 -38
- package/dist/theme.css +35 -0
- package/dist/types/theme/components/aiConverstion.d.ts +22 -0
- package/dist/types/theme/components/index.d.ts +3 -1
- package/dist/types/theme/createTheme/constants.d.ts +9 -0
- package/dist/types/theme/createTheme/index.d.ts +2 -1
- package/dist/types/theme/createTheme/resolveObject.d.ts +24 -0
- package/dist/types/theme/createTheme/utils.d.ts +1 -7
- package/dist/types/theme/index.d.ts +1 -1
- package/dist/types/theme/tokens/components/aiConversation.d.ts +21 -0
- package/dist/types/theme/tokens/components/index.d.ts +2 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/references.d.ts +15 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/package.json +1 -1
package/dist/styles.layer.css
CHANGED
|
@@ -26,6 +26,41 @@
|
|
|
26
26
|
--amplify-components-accordion-item-icon-color: var(--amplify-colors-font-tertiary);
|
|
27
27
|
--amplify-components-accordion-item-icon-transition-duration: var(--amplify-time-medium);
|
|
28
28
|
--amplify-components-accordion-item-icon-transition-timing-function: cubic-bezier(0.87, 0, 0.13, 1);
|
|
29
|
+
--amplify-components-ai-conversation-message-background-color: var(--amplify-colors-background-secondary);
|
|
30
|
+
--amplify-components-ai-conversation-message-border-radius: var(--amplify-radii-large);
|
|
31
|
+
--amplify-components-ai-conversation-message-gap: var(--amplify-space-small);
|
|
32
|
+
--amplify-components-ai-conversation-message-padding-block: var(--amplify-space-small);
|
|
33
|
+
--amplify-components-ai-conversation-message-padding-inline: var(--amplify-space-small);
|
|
34
|
+
--amplify-components-ai-conversation-message-user-background-color: var(--amplify-colors-background-secondary);
|
|
35
|
+
--amplify-components-ai-conversation-message-assistant-background-color: var(--amplify-colors-primary-10);
|
|
36
|
+
--amplify-components-ai-conversation-message-sender-gap: var(--amplify-space-small);
|
|
37
|
+
--amplify-components-ai-conversation-message-sender-username-color: var(--amplify-colors-font-primary);
|
|
38
|
+
--amplify-components-ai-conversation-message-sender-username-font-size: inherit;
|
|
39
|
+
--amplify-components-ai-conversation-message-sender-username-font-weight: var(--amplify-font-weights-bold);
|
|
40
|
+
--amplify-components-ai-conversation-message-sender-timestamp-color: var(--amplify-colors-font-tertiary);
|
|
41
|
+
--amplify-components-ai-conversation-message-sender-timestamp-font-size: inherit;
|
|
42
|
+
--amplify-components-ai-conversation-message-sender-timestamp-font-weight: inherit;
|
|
43
|
+
--amplify-components-ai-conversation-message-body-gap: var(--amplify-space-xs);
|
|
44
|
+
--amplify-components-ai-conversation-form-gap: var(--amplify-space-small);
|
|
45
|
+
--amplify-components-ai-conversation-form-padding: var(--amplify-space-small);
|
|
46
|
+
--amplify-components-ai-conversation-attachment-border-color: var(--amplify-colors-border-secondary);
|
|
47
|
+
--amplify-components-ai-conversation-attachment-border-width: var(--amplify-border-widths-small);
|
|
48
|
+
--amplify-components-ai-conversation-attachment-border-radius: var(--amplify-radii-small);
|
|
49
|
+
--amplify-components-ai-conversation-attachment-font-size: var(--amplify-font-sizes-small);
|
|
50
|
+
--amplify-components-ai-conversation-attachment-padding-block: var(--amplify-space-xxxs);
|
|
51
|
+
--amplify-components-ai-conversation-attachment-padding-inline: var(--amplify-space-xs);
|
|
52
|
+
--amplify-components-ai-conversation-attachment-gap: var(--amplify-space-xs);
|
|
53
|
+
--amplify-components-ai-conversation-attachment-list-padding-block-start: var(--amplify-space-xs);
|
|
54
|
+
--amplify-components-ai-conversation-attachment-list-gap: var(--amplify-space-xxs);
|
|
55
|
+
--amplify-components-ai-conversation-attachment-name-color: var(--amplify-colors-font-primary);
|
|
56
|
+
--amplify-components-ai-conversation-attachment-name-font-size: var(--amplify-font-sizes-small);
|
|
57
|
+
--amplify-components-ai-conversation-attachment-name-font-weight: var(--amplify-font-weights-normal);
|
|
58
|
+
--amplify-components-ai-conversation-attachment-size-color: var(--amplify-colors-font-tertiary);
|
|
59
|
+
--amplify-components-ai-conversation-attachment-size-font-size: var(--amplify-font-sizes-small);
|
|
60
|
+
--amplify-components-ai-conversation-attachment-size-font-weight: var(--amplify-font-weights-normal);
|
|
61
|
+
--amplify-components-ai-conversation-attachment-remove-padding: var(--amplify-space-xxs);
|
|
62
|
+
--amplify-components-ai-conversation-attachment-image-width: var(--amplify-font-sizes-medium);
|
|
63
|
+
--amplify-components-ai-conversation-attachment-image-height: var(--amplify-font-sizes-medium);
|
|
29
64
|
--amplify-components-alert-align-items: center;
|
|
30
65
|
--amplify-components-alert-justify-content: space-between;
|
|
31
66
|
--amplify-components-alert-color: var(--amplify-colors-font-primary);
|
|
@@ -6569,13 +6604,18 @@ html[dir=rtl] .amplify-field-group__inner-start {
|
|
|
6569
6604
|
display: flex;
|
|
6570
6605
|
flex-direction: column;
|
|
6571
6606
|
height: 100%;
|
|
6607
|
+
flex: 1;
|
|
6572
6608
|
}
|
|
6573
6609
|
.amplify-ai-conversation__message {
|
|
6574
|
-
--content-bg:
|
|
6610
|
+
--internal-content-bg: ;
|
|
6611
|
+
--internal-flex-direction: ;
|
|
6612
|
+
--internal-content-padding: ;
|
|
6613
|
+
--internal-body-align-items: ;
|
|
6575
6614
|
display: flex;
|
|
6576
|
-
flex-direction: var(--flex-direction);
|
|
6577
|
-
gap: var(--amplify-
|
|
6578
|
-
padding: var(--amplify-
|
|
6615
|
+
flex-direction: var(--internal-flex-direction);
|
|
6616
|
+
gap: var(--amplify-components-ai-conversation-message-gap);
|
|
6617
|
+
padding-inline: var(--amplify-components-ai-conversation-message-padding-inline);
|
|
6618
|
+
padding-block: var(--amplify-components-ai-conversation-message-padding-block);
|
|
6579
6619
|
}
|
|
6580
6620
|
.amplify-ai-conversation__message__list {
|
|
6581
6621
|
display: flex;
|
|
@@ -6586,89 +6626,105 @@ html[dir=rtl] .amplify-field-group__inner-start {
|
|
|
6586
6626
|
}
|
|
6587
6627
|
.amplify-ai-conversation__message__sender {
|
|
6588
6628
|
display: flex;
|
|
6589
|
-
flex-direction: var(--flex-direction);
|
|
6629
|
+
flex-direction: var(--internal-flex-direction);
|
|
6590
6630
|
align-items: center;
|
|
6591
|
-
height: var(--amplify-components-avatar-height);
|
|
6592
|
-
gap: var(--amplify-
|
|
6631
|
+
min-height: var(--amplify-components-avatar-height);
|
|
6632
|
+
gap: var(--amplify-components-ai-conversation-message-sender-gap);
|
|
6593
6633
|
}
|
|
6594
6634
|
.amplify-ai-conversation__message__sender__username {
|
|
6595
|
-
|
|
6635
|
+
color: var(--amplify-components-ai-conversation-message-sender-username-color);
|
|
6636
|
+
font-size: var(--amplify-components-ai-conversation-message-sender-username-font-size);
|
|
6637
|
+
font-weight: var(--amplify-components-ai-conversation-message-sender-username-font-weight);
|
|
6596
6638
|
}
|
|
6597
6639
|
.amplify-ai-conversation__message__sender__timestamp {
|
|
6598
|
-
color: var(--amplify-
|
|
6599
|
-
font-size: var(--amplify-font-
|
|
6640
|
+
color: var(--amplify-components-ai-conversation-message-sender-timestamp-color);
|
|
6641
|
+
font-size: var(--amplify-components-ai-conversation-message-sender-timestamp-font-size);
|
|
6642
|
+
font-weight: var(--amplify-components-ai-conversation-message-sender-timestamp-font-weight);
|
|
6600
6643
|
}
|
|
6601
6644
|
.amplify-ai-conversation__message__body {
|
|
6602
6645
|
display: flex;
|
|
6603
6646
|
flex-direction: column;
|
|
6604
|
-
align-items: var(--body-align-items);
|
|
6605
|
-
gap: var(--amplify-
|
|
6647
|
+
align-items: var(--internal-body-align-items);
|
|
6648
|
+
gap: var(--amplify-components-ai-conversation-message-body-gap);
|
|
6606
6649
|
}
|
|
6607
6650
|
.amplify-ai-conversation__message__content {
|
|
6608
|
-
background-color: var(--content-bg);
|
|
6651
|
+
background-color: var(--internal-content-bg);
|
|
6609
6652
|
border-radius: var(--amplify-radii-medium);
|
|
6610
|
-
padding: var(--content-padding);
|
|
6653
|
+
padding: var(--internal-content-padding);
|
|
6611
6654
|
}
|
|
6612
6655
|
.amplify-ai-conversation__message__actions {
|
|
6613
6656
|
display: flex;
|
|
6614
6657
|
flex-direction: row;
|
|
6615
6658
|
}
|
|
6616
6659
|
.amplify-ai-conversation__message--bubble {
|
|
6617
|
-
--content-bg: var(--bg-color);
|
|
6618
|
-
--content-padding: var(--amplify-space-xxs)
|
|
6619
|
-
|
|
6620
|
-
--
|
|
6660
|
+
--internal-content-bg: var(--internal-bg-color);
|
|
6661
|
+
--internal-content-padding: var(--amplify-space-xxs)
|
|
6662
|
+
var(--amplify-space-xs);
|
|
6663
|
+
--internal-flex-direction: row-reverse;
|
|
6664
|
+
--internal-body-align-items: flex-end;
|
|
6621
6665
|
}
|
|
6622
6666
|
.amplify-ai-conversation__message--user {
|
|
6623
|
-
--bg-color: var(
|
|
6667
|
+
--internal-bg-color: var(
|
|
6668
|
+
--amplify-components-ai-conversation-message-user-background-color
|
|
6669
|
+
);
|
|
6624
6670
|
}
|
|
6625
6671
|
.amplify-ai-conversation__message--assistant {
|
|
6626
|
-
--bg-color: var(
|
|
6627
|
-
|
|
6628
|
-
|
|
6672
|
+
--internal-bg-color: var(
|
|
6673
|
+
--amplify-components-ai-conversation-message-assistant-background-color
|
|
6674
|
+
);
|
|
6675
|
+
--internal-flex-direction: row;
|
|
6676
|
+
--internal-body-align-items: flex-start;
|
|
6629
6677
|
}
|
|
6630
6678
|
.amplify-ai-conversation__form {
|
|
6631
6679
|
display: flex;
|
|
6632
6680
|
flex-direction: row;
|
|
6633
6681
|
align-items: flex-start;
|
|
6634
|
-
gap: var(--amplify-
|
|
6682
|
+
gap: var(--amplify-components-ai-conversation-form-gap);
|
|
6683
|
+
padding: var(--amplify-components-ai-conversation-form-padding);
|
|
6635
6684
|
}
|
|
6636
6685
|
.amplify-ai-conversation__form__dropzone {
|
|
6637
6686
|
text-align: initial;
|
|
6638
6687
|
border: none;
|
|
6639
|
-
padding:
|
|
6688
|
+
padding: 0;
|
|
6640
6689
|
}
|
|
6641
6690
|
.amplify-ai-conversation__attachment {
|
|
6642
6691
|
display: flex;
|
|
6643
6692
|
flex-direction: row;
|
|
6644
|
-
padding-block: var(--amplify-space-xxxs);
|
|
6645
|
-
padding-inline: var(--amplify-space-xs);
|
|
6646
|
-
border-width: var(--amplify-border-widths-small);
|
|
6647
|
-
border-style: solid;
|
|
6648
|
-
border-color: var(--amplify-colors-border-secondary);
|
|
6649
|
-
border-radius: var(--amplify-radii-small);
|
|
6650
6693
|
align-items: center;
|
|
6651
|
-
|
|
6652
|
-
|
|
6694
|
+
padding-block: var(--amplify-components-ai-conversation-attachment-padding-block);
|
|
6695
|
+
padding-inline: var(--amplify-components-ai-conversation-attachment-padding-inline);
|
|
6696
|
+
border-width: var(--amplify-components-ai-conversation-attachment-border-width);
|
|
6697
|
+
border-style: solid;
|
|
6698
|
+
border-color: var(--amplify-components-ai-conversation-attachment-border-color);
|
|
6699
|
+
border-radius: var(--amplify-components-ai-conversation-attachment-border-radius);
|
|
6700
|
+
gap: var(--amplify-components-ai-conversation-attachment-gap);
|
|
6701
|
+
font-size: var(--amplify-components-ai-conversation-attachment-font-size);
|
|
6653
6702
|
}
|
|
6654
6703
|
.amplify-ai-conversation__attachment__list {
|
|
6655
6704
|
display: flex;
|
|
6656
6705
|
flex-direction: row;
|
|
6657
6706
|
flex-wrap: wrap;
|
|
6658
|
-
gap: var(--amplify-
|
|
6659
|
-
padding-block-start: var(--amplify-
|
|
6707
|
+
gap: var(--amplify-components-ai-conversation-attachment-list-gap);
|
|
6708
|
+
padding-block-start: var(--amplify-components-ai-conversation-attachment-padding-block-start);
|
|
6660
6709
|
}
|
|
6661
6710
|
.amplify-ai-conversation__attachment__image {
|
|
6662
|
-
width:
|
|
6663
|
-
height:
|
|
6711
|
+
width: var(--amplify-components-ai-conversation-attachment-image-width);
|
|
6712
|
+
height: var(--amplify-components-ai-conversation-attachment-image-height);
|
|
6664
6713
|
-o-object-fit: cover;
|
|
6665
6714
|
object-fit: cover;
|
|
6666
6715
|
}
|
|
6716
|
+
.amplify-ai-conversation__attachment__name {
|
|
6717
|
+
color: var(--amplify-components-ai-conversation-attachment-name-color);
|
|
6718
|
+
font-size: var(--amplify-components-ai-conversation-attachment-name-font-size);
|
|
6719
|
+
font-weight: var(--amplify-components-ai-conversation-attachment-name-font-weight);
|
|
6720
|
+
}
|
|
6667
6721
|
.amplify-ai-conversation__attachment__size {
|
|
6668
|
-
color: var(--amplify-
|
|
6722
|
+
color: var(--amplify-components-ai-conversation-attachment-size-color);
|
|
6723
|
+
font-size: var(--amplify-components-ai-conversation-attachment-size-font-size);
|
|
6724
|
+
font-weight: var(--amplify-components-ai-conversation-attachment-size-font-weight);
|
|
6669
6725
|
}
|
|
6670
6726
|
.amplify-ai-conversation__attachment__remove {
|
|
6671
|
-
padding: var(--amplify-
|
|
6727
|
+
padding: var(--amplify-components-ai-conversation-attachment-remove-padding);
|
|
6672
6728
|
}
|
|
6673
6729
|
.amplify-ai-conversation__prompt {
|
|
6674
6730
|
font-weight: normal;
|
package/dist/theme.css
CHANGED
|
@@ -22,6 +22,41 @@
|
|
|
22
22
|
--amplify-components-accordion-item-icon-color: var(--amplify-colors-font-tertiary);
|
|
23
23
|
--amplify-components-accordion-item-icon-transition-duration: var(--amplify-time-medium);
|
|
24
24
|
--amplify-components-accordion-item-icon-transition-timing-function: cubic-bezier(0.87, 0, 0.13, 1);
|
|
25
|
+
--amplify-components-ai-conversation-message-background-color: var(--amplify-colors-background-secondary);
|
|
26
|
+
--amplify-components-ai-conversation-message-border-radius: var(--amplify-radii-large);
|
|
27
|
+
--amplify-components-ai-conversation-message-gap: var(--amplify-space-small);
|
|
28
|
+
--amplify-components-ai-conversation-message-padding-block: var(--amplify-space-small);
|
|
29
|
+
--amplify-components-ai-conversation-message-padding-inline: var(--amplify-space-small);
|
|
30
|
+
--amplify-components-ai-conversation-message-user-background-color: var(--amplify-colors-background-secondary);
|
|
31
|
+
--amplify-components-ai-conversation-message-assistant-background-color: var(--amplify-colors-primary-10);
|
|
32
|
+
--amplify-components-ai-conversation-message-sender-gap: var(--amplify-space-small);
|
|
33
|
+
--amplify-components-ai-conversation-message-sender-username-color: var(--amplify-colors-font-primary);
|
|
34
|
+
--amplify-components-ai-conversation-message-sender-username-font-size: inherit;
|
|
35
|
+
--amplify-components-ai-conversation-message-sender-username-font-weight: var(--amplify-font-weights-bold);
|
|
36
|
+
--amplify-components-ai-conversation-message-sender-timestamp-color: var(--amplify-colors-font-tertiary);
|
|
37
|
+
--amplify-components-ai-conversation-message-sender-timestamp-font-size: inherit;
|
|
38
|
+
--amplify-components-ai-conversation-message-sender-timestamp-font-weight: inherit;
|
|
39
|
+
--amplify-components-ai-conversation-message-body-gap: var(--amplify-space-xs);
|
|
40
|
+
--amplify-components-ai-conversation-form-gap: var(--amplify-space-small);
|
|
41
|
+
--amplify-components-ai-conversation-form-padding: var(--amplify-space-small);
|
|
42
|
+
--amplify-components-ai-conversation-attachment-border-color: var(--amplify-colors-border-secondary);
|
|
43
|
+
--amplify-components-ai-conversation-attachment-border-width: var(--amplify-border-widths-small);
|
|
44
|
+
--amplify-components-ai-conversation-attachment-border-radius: var(--amplify-radii-small);
|
|
45
|
+
--amplify-components-ai-conversation-attachment-font-size: var(--amplify-font-sizes-small);
|
|
46
|
+
--amplify-components-ai-conversation-attachment-padding-block: var(--amplify-space-xxxs);
|
|
47
|
+
--amplify-components-ai-conversation-attachment-padding-inline: var(--amplify-space-xs);
|
|
48
|
+
--amplify-components-ai-conversation-attachment-gap: var(--amplify-space-xs);
|
|
49
|
+
--amplify-components-ai-conversation-attachment-list-padding-block-start: var(--amplify-space-xs);
|
|
50
|
+
--amplify-components-ai-conversation-attachment-list-gap: var(--amplify-space-xxs);
|
|
51
|
+
--amplify-components-ai-conversation-attachment-name-color: var(--amplify-colors-font-primary);
|
|
52
|
+
--amplify-components-ai-conversation-attachment-name-font-size: var(--amplify-font-sizes-small);
|
|
53
|
+
--amplify-components-ai-conversation-attachment-name-font-weight: var(--amplify-font-weights-normal);
|
|
54
|
+
--amplify-components-ai-conversation-attachment-size-color: var(--amplify-colors-font-tertiary);
|
|
55
|
+
--amplify-components-ai-conversation-attachment-size-font-size: var(--amplify-font-sizes-small);
|
|
56
|
+
--amplify-components-ai-conversation-attachment-size-font-weight: var(--amplify-font-weights-normal);
|
|
57
|
+
--amplify-components-ai-conversation-attachment-remove-padding: var(--amplify-space-xxs);
|
|
58
|
+
--amplify-components-ai-conversation-attachment-image-width: var(--amplify-font-sizes-medium);
|
|
59
|
+
--amplify-components-ai-conversation-attachment-image-height: var(--amplify-font-sizes-medium);
|
|
25
60
|
--amplify-components-alert-align-items: center;
|
|
26
61
|
--amplify-components-alert-justify-content: space-between;
|
|
27
62
|
--amplify-components-alert-color: var(--amplify-colors-font-primary);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Modifiers, ComponentStyles, Elements } from './utils';
|
|
2
|
+
export type AIConversationTheme<Required extends boolean = false> = ComponentStyles & Elements<{
|
|
3
|
+
message?: ComponentStyles & Modifiers<'user' | 'assistant' | 'bubble', Required>;
|
|
4
|
+
message__list?: ComponentStyles;
|
|
5
|
+
message__avatar?: ComponentStyles;
|
|
6
|
+
message__sender?: ComponentStyles;
|
|
7
|
+
message__sender__username?: ComponentStyles;
|
|
8
|
+
message__sender__timestamp?: ComponentStyles;
|
|
9
|
+
message__body?: ComponentStyles;
|
|
10
|
+
message__actions?: ComponentStyles;
|
|
11
|
+
form?: ComponentStyles;
|
|
12
|
+
form__dropzone?: ComponentStyles;
|
|
13
|
+
form__attatch?: ComponentStyles;
|
|
14
|
+
form__send?: ComponentStyles;
|
|
15
|
+
form_field?: ComponentStyles;
|
|
16
|
+
attachment?: ComponentStyles;
|
|
17
|
+
attachment__list?: ComponentStyles;
|
|
18
|
+
attachment__image?: ComponentStyles;
|
|
19
|
+
attachment__size?: ComponentStyles;
|
|
20
|
+
attachment__name?: ComponentStyles;
|
|
21
|
+
attachment__remove?: ComponentStyles;
|
|
22
|
+
}, Required>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { WebTokens } from '../tokens';
|
|
2
|
+
import { AIConversationTheme } from './aiConverstion';
|
|
2
3
|
import { AccordionTheme } from './accordion';
|
|
3
4
|
import { AlertTheme } from './alert';
|
|
4
5
|
import { AutoCompleteTheme } from './autocomplete';
|
|
@@ -45,9 +46,10 @@ import { ToggleButtonTheme, ToggleButtonGroupTheme } from './toggleButton';
|
|
|
45
46
|
import { ComponentTheme, BaseComponentTheme, BaseTheme } from './utils';
|
|
46
47
|
export { ClassNameFunction } from '../createTheme/createComponentClasses';
|
|
47
48
|
export type { ComponentTheme, BaseComponentTheme, BaseTheme };
|
|
48
|
-
export type ComponentsTheme<TokensType extends WebTokens = WebTokens> = BaseComponentTheme<BaseTheme, string, TokensType> | BaseComponentTheme<AccordionTheme, 'accordion', TokensType> | BaseComponentTheme<AlertTheme, 'alert', TokensType> | BaseComponentTheme<AutoCompleteTheme, 'autocomplete', TokensType> | BaseComponentTheme<AvatarTheme, 'avatar', TokensType> | BaseComponentTheme<BadgeTheme, 'badge', TokensType> | BaseComponentTheme<BreadcrumbsTheme, 'breadcrumbs', TokensType> | BaseComponentTheme<ButtonTheme, 'button', TokensType> | BaseComponentTheme<ButtonGroupTheme, 'buttongroup', TokensType> | BaseComponentTheme<CardTheme, 'card', TokensType> | BaseComponentTheme<CheckboxTheme, 'checkbox', TokensType> | BaseComponentTheme<CheckboxFieldTheme, 'checkboxfield', TokensType> | BaseComponentTheme<CollectionTheme, 'collection', TokensType> | BaseComponentTheme<DividerTheme, 'divider', TokensType> | BaseComponentTheme<DropZoneTheme, 'dropzone', TokensType> | BaseComponentTheme<FieldTheme, 'field', TokensType> | BaseComponentTheme<FieldGroupTheme, 'field-group', TokensType> | BaseComponentTheme<FieldsetTheme, 'fieldset', TokensType> | BaseComponentTheme<FileUploaderTheme, 'fileuploader', TokensType> | BaseComponentTheme<HeadingTheme, 'heading', TokensType> | BaseComponentTheme<HighlightMatchTheme, 'highlightmatch', TokensType> | BaseComponentTheme<InputTheme, 'input', TokensType> | BaseComponentTheme<LoaderTheme, 'loader', TokensType> | BaseComponentTheme<MenuTheme, 'menu', TokensType> | BaseComponentTheme<MessageTheme, 'message', TokensType> | BaseComponentTheme<PaginationTheme, 'pagination', TokensType> | BaseComponentTheme<PlaceholderTheme, 'placeholder', TokensType> | BaseComponentTheme<RatingTheme, 'rating', TokensType> | BaseComponentTheme<RadioTheme, 'radio', TokensType> | BaseComponentTheme<ScrollViewTheme, 'scrollview', TokensType> | BaseComponentTheme<SearchFieldTheme, 'searchfield', TokensType> | BaseComponentTheme<SelectTheme, 'select', TokensType> | BaseComponentTheme<SelectFieldTheme, 'selectfield', TokensType> | BaseComponentTheme<SliderFieldTheme, 'sliderfield', TokensType> | BaseComponentTheme<StepperFieldTheme, 'stepperfield', TokensType> | BaseComponentTheme<StorageManagerTheme, 'storagemanager', TokensType> | BaseComponentTheme<SwitchTheme, 'switch', TokensType> | BaseComponentTheme<SwitchFieldTheme, 'switchfield', TokensType> | BaseComponentTheme<TabsTheme, 'tabs', TokensType> | BaseComponentTheme<TableTheme, 'table', TokensType> | BaseComponentTheme<TextTheme, 'text', TokensType> | BaseComponentTheme<TextareaTheme, 'textarea', TokensType> | BaseComponentTheme<TextareaFieldTheme, 'textareafield', TokensType> | BaseComponentTheme<TextFieldTheme, 'textfield', TokensType> | BaseComponentTheme<ToggleButtonTheme, 'togglebutton', TokensType> | BaseComponentTheme<ToggleButtonGroupTheme, 'togglebuttongroup', TokensType>;
|
|
49
|
+
export type ComponentsTheme<TokensType extends WebTokens = WebTokens> = BaseComponentTheme<BaseTheme, string, TokensType> | BaseComponentTheme<AccordionTheme, 'accordion', TokensType> | BaseComponentTheme<AIConversationTheme, 'ai-conversation', TokensType> | BaseComponentTheme<AlertTheme, 'alert', TokensType> | BaseComponentTheme<AutoCompleteTheme, 'autocomplete', TokensType> | BaseComponentTheme<AvatarTheme, 'avatar', TokensType> | BaseComponentTheme<BadgeTheme, 'badge', TokensType> | BaseComponentTheme<BreadcrumbsTheme, 'breadcrumbs', TokensType> | BaseComponentTheme<ButtonTheme, 'button', TokensType> | BaseComponentTheme<ButtonGroupTheme, 'buttongroup', TokensType> | BaseComponentTheme<CardTheme, 'card', TokensType> | BaseComponentTheme<CheckboxTheme, 'checkbox', TokensType> | BaseComponentTheme<CheckboxFieldTheme, 'checkboxfield', TokensType> | BaseComponentTheme<CollectionTheme, 'collection', TokensType> | BaseComponentTheme<DividerTheme, 'divider', TokensType> | BaseComponentTheme<DropZoneTheme, 'dropzone', TokensType> | BaseComponentTheme<FieldTheme, 'field', TokensType> | BaseComponentTheme<FieldGroupTheme, 'field-group', TokensType> | BaseComponentTheme<FieldsetTheme, 'fieldset', TokensType> | BaseComponentTheme<FileUploaderTheme, 'fileuploader', TokensType> | BaseComponentTheme<HeadingTheme, 'heading', TokensType> | BaseComponentTheme<HighlightMatchTheme, 'highlightmatch', TokensType> | BaseComponentTheme<InputTheme, 'input', TokensType> | BaseComponentTheme<LoaderTheme, 'loader', TokensType> | BaseComponentTheme<MenuTheme, 'menu', TokensType> | BaseComponentTheme<MessageTheme, 'message', TokensType> | BaseComponentTheme<PaginationTheme, 'pagination', TokensType> | BaseComponentTheme<PlaceholderTheme, 'placeholder', TokensType> | BaseComponentTheme<RatingTheme, 'rating', TokensType> | BaseComponentTheme<RadioTheme, 'radio', TokensType> | BaseComponentTheme<ScrollViewTheme, 'scrollview', TokensType> | BaseComponentTheme<SearchFieldTheme, 'searchfield', TokensType> | BaseComponentTheme<SelectTheme, 'select', TokensType> | BaseComponentTheme<SelectFieldTheme, 'selectfield', TokensType> | BaseComponentTheme<SliderFieldTheme, 'sliderfield', TokensType> | BaseComponentTheme<StepperFieldTheme, 'stepperfield', TokensType> | BaseComponentTheme<StorageManagerTheme, 'storagemanager', TokensType> | BaseComponentTheme<SwitchTheme, 'switch', TokensType> | BaseComponentTheme<SwitchFieldTheme, 'switchfield', TokensType> | BaseComponentTheme<TabsTheme, 'tabs', TokensType> | BaseComponentTheme<TableTheme, 'table', TokensType> | BaseComponentTheme<TextTheme, 'text', TokensType> | BaseComponentTheme<TextareaTheme, 'textarea', TokensType> | BaseComponentTheme<TextareaFieldTheme, 'textareafield', TokensType> | BaseComponentTheme<TextFieldTheme, 'textfield', TokensType> | BaseComponentTheme<ToggleButtonTheme, 'togglebutton', TokensType> | BaseComponentTheme<ToggleButtonGroupTheme, 'togglebuttongroup', TokensType>;
|
|
49
50
|
export type AllComponentThemes = {
|
|
50
51
|
accordion: AccordionTheme;
|
|
52
|
+
'ai-conversation': AIConversationTheme;
|
|
51
53
|
alert: AlertTheme;
|
|
52
54
|
autocomplete: AutoCompleteTheme;
|
|
53
55
|
avatar: AvatarTheme;
|
|
@@ -2,5 +2,6 @@ export { createTheme } from './createTheme';
|
|
|
2
2
|
export { defineComponentTheme } from './defineComponentTheme';
|
|
3
3
|
export { createComponentCSS } from './createComponentCSS';
|
|
4
4
|
export { createGlobalCSS } from './createGlobalCSS';
|
|
5
|
-
export { cssNameTransform, setupTokens, SetupToken,
|
|
5
|
+
export { cssNameTransform, deepExtend, isDesignToken, setupTokens, SetupToken, } from './utils';
|
|
6
6
|
export { createComponentClasses, ClassNameArgs, } from './createComponentClasses';
|
|
7
|
+
export { resolveObject } from './resolveObject';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare function resolveObject<T>(object: Record<string, any>): T;
|
|
2
|
+
/**
|
|
3
|
+
* Recursively traverses an object (slice) to resolve and uses
|
|
4
|
+
* compileValue to replace any string references found within it
|
|
5
|
+
*/
|
|
6
|
+
export declare function traverseObject<T>({ slice, fullObj, currentContext, foundCirc, }: {
|
|
7
|
+
slice: any;
|
|
8
|
+
fullObj: any;
|
|
9
|
+
currentContext: any;
|
|
10
|
+
foundCirc: any;
|
|
11
|
+
}): T;
|
|
12
|
+
/**
|
|
13
|
+
* Resolves references in a value, performing recursive lookups when references are nested.
|
|
14
|
+
* value: The string that may contain references (e.g., {color.border.light}) that need to be replaced
|
|
15
|
+
* stack: keeps track of the current chain of references to detect circular references
|
|
16
|
+
* foundCirc: stores any detected circular references
|
|
17
|
+
* fullObj: The full object where references are looked up, essentially the source of all values
|
|
18
|
+
*/
|
|
19
|
+
export declare function compileValue({ value, stack, foundCirc, fullObj }: {
|
|
20
|
+
value: any;
|
|
21
|
+
stack: any;
|
|
22
|
+
foundCirc: any;
|
|
23
|
+
fullObj: any;
|
|
24
|
+
}): any;
|
|
@@ -63,7 +63,7 @@ type SetupTokensProps = {
|
|
|
63
63
|
* and perform the setupToken function on each token.
|
|
64
64
|
* Similar to what Style Dictionary does.
|
|
65
65
|
*/
|
|
66
|
-
export declare function setupTokens({ tokens, path, setupToken, }: SetupTokensProps): any
|
|
66
|
+
export declare function setupTokens({ tokens, path, setupToken, }: SetupTokensProps): Record<string, any>;
|
|
67
67
|
/**
|
|
68
68
|
* Takes an plain javascript object and will make a flat array of all the leaf nodes.
|
|
69
69
|
* A leaf node in this context has a 'value' property. Potentially refactor this to
|
|
@@ -83,10 +83,4 @@ export declare function flattenProperties(properties: object, to_ret?: object[])
|
|
|
83
83
|
* @returns {Object}
|
|
84
84
|
*/
|
|
85
85
|
export declare function deepExtend<T>(objects?: (object | undefined)[], collision?: Function, path?: string[]): T;
|
|
86
|
-
/**
|
|
87
|
-
* Checks if the value uses a value reference.
|
|
88
|
-
* @param {string} value
|
|
89
|
-
* @returns {boolean} - True, if the value uses a value reference
|
|
90
|
-
*/
|
|
91
|
-
export declare function usesReference(value: any): boolean;
|
|
92
86
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { createTheme, defineComponentTheme, createComponentClasses, createComponentCSS, createGlobalCSS, cssNameTransform, isDesignToken, setupTokens, SetupToken, } from './createTheme';
|
|
1
|
+
export { createTheme, deepExtend, defineComponentTheme, createComponentClasses, createComponentCSS, createGlobalCSS, cssNameTransform, isDesignToken, resolveObject, setupTokens, SetupToken, } from './createTheme';
|
|
2
2
|
export { BaseComponentTheme } from './components';
|
|
3
3
|
export { defaultTheme } from './defaultTheme';
|
|
4
4
|
export { defaultDarkModeOverride, reactNativeDarkTokens, } from './defaultDarkModeOverride';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DesignTokenProperties, OutputVariantKey } from '../types/designToken';
|
|
2
|
+
export interface AIConversationTokens<OutputType extends OutputVariantKey> {
|
|
3
|
+
message?: DesignTokenProperties<'backgroundColor' | 'borderRadius' | 'paddingBlock' | 'paddingInline' | 'gap', OutputType> & {
|
|
4
|
+
sender?: DesignTokenProperties<'gap', OutputType> & {
|
|
5
|
+
username?: DesignTokenProperties<'color' | 'fontSize' | 'fontWeight', OutputType>;
|
|
6
|
+
timestamp?: DesignTokenProperties<'color' | 'fontSize' | 'fontWeight', OutputType>;
|
|
7
|
+
};
|
|
8
|
+
body?: DesignTokenProperties<'gap', OutputType>;
|
|
9
|
+
user?: DesignTokenProperties<'backgroundColor', OutputType>;
|
|
10
|
+
assistant?: DesignTokenProperties<'backgroundColor', OutputType>;
|
|
11
|
+
};
|
|
12
|
+
form?: DesignTokenProperties<'gap' | 'padding', OutputType>;
|
|
13
|
+
attachment?: DesignTokenProperties<'borderColor' | 'borderWidth' | 'borderRadius' | 'fontSize' | 'paddingBlock' | 'paddingInline' | 'gap', OutputType> & {
|
|
14
|
+
list?: DesignTokenProperties<'paddingBlockStart' | 'gap', OutputType>;
|
|
15
|
+
image?: DesignTokenProperties<'width' | 'height', OutputType>;
|
|
16
|
+
size?: DesignTokenProperties<'color' | 'fontSize' | 'fontWeight', OutputType>;
|
|
17
|
+
name?: DesignTokenProperties<'color' | 'fontSize' | 'fontWeight', OutputType>;
|
|
18
|
+
remove?: DesignTokenProperties<'padding', OutputType>;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export declare const aiConversation: Required<AIConversationTokens<'default'>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AlertTokens } from './alert';
|
|
2
|
+
import { AIConversationTokens } from './aiConversation';
|
|
2
3
|
import { AutocompleteTokens } from './autocomplete';
|
|
3
4
|
import { AuthenticatorTokens } from './authenticator';
|
|
4
5
|
import { AvatarTokens } from './avatar';
|
|
@@ -56,6 +57,7 @@ import { ToggleButtonGroupTokens } from './toggleButtonGroup';
|
|
|
56
57
|
import { OutputVariantKey } from '../types/designToken';
|
|
57
58
|
type BaseComponentTokens<Output extends OutputVariantKey> = {
|
|
58
59
|
accordion?: AccordionTokens<Output>;
|
|
60
|
+
aiConversation?: AIConversationTokens<Output>;
|
|
59
61
|
alert?: AlertTokens<Output>;
|
|
60
62
|
authenticator?: AuthenticatorTokens<Output>;
|
|
61
63
|
autocomplete?: AutocompleteTokens<Output>;
|
|
@@ -2,3 +2,4 @@ export { setUserAgent, SetUserAgentOptions } from './setUserAgent';
|
|
|
2
2
|
export * from './utils';
|
|
3
3
|
export { classNames, ClassNamesArgs } from './classNames';
|
|
4
4
|
export { humanFileSize } from './humanFileSize';
|
|
5
|
+
export { getName, getPathFromName, resolveReference, usesReference, } from './references';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if the value uses a value reference.
|
|
3
|
+
* @param {string} value
|
|
4
|
+
* @returns {boolean} - True, if the value uses a value reference
|
|
5
|
+
*/
|
|
6
|
+
export declare function usesReference(value: unknown): boolean;
|
|
7
|
+
export declare function resolveReference(path: string[], obj: object): object;
|
|
8
|
+
/**
|
|
9
|
+
* Returns the path from a path name be splitting the name by a given separator.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getPathFromName(pathName: string): string[];
|
|
12
|
+
/**
|
|
13
|
+
* Returns the paths name be joining its parts with a given separator.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getName(path: Array<string>): string;
|
|
@@ -146,3 +146,4 @@ export declare function groupLog(groupName: string, ...events: any[]): void;
|
|
|
146
146
|
* @returns
|
|
147
147
|
*/
|
|
148
148
|
export declare function splitObject(obj: Record<string, unknown>, predicate: (key: string) => boolean): readonly [Record<string, unknown>, Record<string, unknown>];
|
|
149
|
+
export declare const cloneDeep: (obj: unknown) => any;
|