@workday/canvas-kit-labs-react 14.0.0-alpha.1153-next.0 → 14.0.0-alpha.1162-next.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.
- package/ai-assistant-ingress-button/index.ts +2 -0
- package/ai-assistant-ingress-button/lib/AiAssistantIngressButton.tsx +179 -0
- package/ai-assistant-ingress-button/lib/AiAssistantIngressIcon.tsx +20 -0
- package/ai-assistant-ingress-button/package.json +6 -0
- package/dist/commonjs/ai-assistant-ingress-button/index.d.ts +3 -0
- package/dist/commonjs/ai-assistant-ingress-button/index.d.ts.map +1 -0
- package/dist/commonjs/ai-assistant-ingress-button/index.js +18 -0
- package/dist/commonjs/ai-assistant-ingress-button/lib/AiAssistantIngressButton.d.ts +1993 -0
- package/dist/commonjs/ai-assistant-ingress-button/lib/AiAssistantIngressButton.d.ts.map +1 -0
- package/dist/commonjs/ai-assistant-ingress-button/lib/AiAssistantIngressButton.js +57 -0
- package/dist/commonjs/ai-assistant-ingress-button/lib/AiAssistantIngressIcon.d.ts +3 -0
- package/dist/commonjs/ai-assistant-ingress-button/lib/AiAssistantIngressIcon.d.ts.map +1 -0
- package/dist/commonjs/ai-assistant-ingress-button/lib/AiAssistantIngressIcon.js +23 -0
- package/dist/commonjs/index.d.ts +1 -0
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +1 -0
- package/dist/commonjs/search-form/lib/SearchForm.js +14 -14
- package/dist/es6/ai-assistant-ingress-button/index.d.ts +3 -0
- package/dist/es6/ai-assistant-ingress-button/index.d.ts.map +1 -0
- package/dist/es6/ai-assistant-ingress-button/index.js +2 -0
- package/dist/es6/ai-assistant-ingress-button/lib/AiAssistantIngressButton.d.ts +1993 -0
- package/dist/es6/ai-assistant-ingress-button/lib/AiAssistantIngressButton.d.ts.map +1 -0
- package/dist/es6/ai-assistant-ingress-button/lib/AiAssistantIngressButton.js +54 -0
- package/dist/es6/ai-assistant-ingress-button/lib/AiAssistantIngressIcon.d.ts +3 -0
- package/dist/es6/ai-assistant-ingress-button/lib/AiAssistantIngressIcon.d.ts.map +1 -0
- package/dist/es6/ai-assistant-ingress-button/lib/AiAssistantIngressIcon.js +19 -0
- package/dist/es6/index.d.ts +1 -0
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +1 -0
- package/dist/es6/search-form/lib/SearchForm.js +14 -14
- package/index.ts +1 -0
- package/package.json +6 -6
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import {createComponent, focusRing, useUniqueId} from '@workday/canvas-kit-react/common';
|
|
2
|
+
import {BaseButton, BaseButtonProps, buttonStencil} from '@workday/canvas-kit-react/button';
|
|
3
|
+
import {createStencil, handleCsProp, calc} from '@workday/canvas-kit-styling';
|
|
4
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
5
|
+
import {systemIconStencil} from '@workday/canvas-kit-react/icon';
|
|
6
|
+
import {getAiAssistantIngressIcon} from './AiAssistantIngressIcon';
|
|
7
|
+
export interface AiAssistantIngressButtonProps
|
|
8
|
+
extends Omit<BaseButtonProps, 'size' | 'colors' | 'icon' | 'iconPosition' | 'shouldMirrorIcon'> {
|
|
9
|
+
/**
|
|
10
|
+
* When true, indicates that the assistant side panel is open.
|
|
11
|
+
*/
|
|
12
|
+
toggled?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Used on dark backgrounds.
|
|
15
|
+
*/
|
|
16
|
+
variant?: 'inverse';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Icon gradient colors
|
|
21
|
+
*/
|
|
22
|
+
const illuminateStopColor1 = '#FFA198';
|
|
23
|
+
const illuminateStopColor2 = '#FFCAA0';
|
|
24
|
+
const illuminateStopColor3 = '#FFCA79';
|
|
25
|
+
const illuminateStopColor4 = '#FDCA44';
|
|
26
|
+
const illuminateStopColor5 = '#FFB74D';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Box shadow glow colors
|
|
30
|
+
*/
|
|
31
|
+
const glowEraser = '#FFC2FD';
|
|
32
|
+
const glowHighlighter = '#FFF3A8';
|
|
33
|
+
const glowLunchBreak = '#FEC10B';
|
|
34
|
+
const glowHappyHour = '#FD7E00';
|
|
35
|
+
const glowThumbtack = '#FC5B05';
|
|
36
|
+
|
|
37
|
+
export const aiAssistantIngressButtonStencil = createStencil({
|
|
38
|
+
extends: buttonStencil,
|
|
39
|
+
base: {
|
|
40
|
+
[buttonStencil.vars.background]: system.color.bg.ai.strongest,
|
|
41
|
+
borderRadius: system.shape.round,
|
|
42
|
+
height: calc.add(system.space.x10, system.space.x1),
|
|
43
|
+
width: calc.add(system.space.x10, system.space.x1),
|
|
44
|
+
transition: 'box-shadow 300ms ease-out, background 300ms ease-out',
|
|
45
|
+
|
|
46
|
+
'.wd-icon-ai-assistant-ingress-button': {
|
|
47
|
+
'.wd-icon-fill': {
|
|
48
|
+
transition: 'fill 300ms ease-out',
|
|
49
|
+
},
|
|
50
|
+
'> linearGradient > stop': {
|
|
51
|
+
transition: '300ms ease-out',
|
|
52
|
+
stopColor: system.color.fg.inverse,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
'&:is(:hover, .hover):not(:disabled, .disabled)': {
|
|
57
|
+
'.wd-icon-ai-assistant-ingress-button': {
|
|
58
|
+
'linearGradient > stop:first-child': {
|
|
59
|
+
stopColor: illuminateStopColor1,
|
|
60
|
+
},
|
|
61
|
+
'linearGradient > stop:nth-child(2)': {
|
|
62
|
+
stopColor: illuminateStopColor2,
|
|
63
|
+
},
|
|
64
|
+
'linearGradient > stop:nth-child(3)': {
|
|
65
|
+
stopColor: illuminateStopColor3,
|
|
66
|
+
},
|
|
67
|
+
'linearGradient > stop:nth-child(4)': {
|
|
68
|
+
stopColor: illuminateStopColor4,
|
|
69
|
+
},
|
|
70
|
+
'linearGradient > stop:nth-child(5)': {
|
|
71
|
+
stopColor: illuminateStopColor5,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
'&:disabled, &:disabled:active, &.disabled': {
|
|
76
|
+
opacity: system.opacity.disabled,
|
|
77
|
+
},
|
|
78
|
+
'&:is(:focus-visible, .focus):not(:disabled, .disabled)': {
|
|
79
|
+
...focusRing({width: 2, separation: 0}),
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
modifiers: {
|
|
83
|
+
variant: {
|
|
84
|
+
inverse: {
|
|
85
|
+
[buttonStencil.vars.background]: system.color.bg.default,
|
|
86
|
+
'.wd-icon-ai-assistant-ingress-button': {
|
|
87
|
+
'.wd-icon-fill': {
|
|
88
|
+
transition: 'fill 300ms ease-out',
|
|
89
|
+
},
|
|
90
|
+
'> linearGradient > stop': {
|
|
91
|
+
transition: '300ms ease-out',
|
|
92
|
+
stopColor: system.color.fg.ai,
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
'&:is(:hover, .hover):not(:disabled, .disabled)': {
|
|
96
|
+
'.wd-icon-ai-assistant-ingress-button': {
|
|
97
|
+
'linearGradient > stop:first-child': {
|
|
98
|
+
stopColor: illuminateStopColor1,
|
|
99
|
+
},
|
|
100
|
+
'linearGradient > stop:nth-child(2)': {
|
|
101
|
+
stopColor: illuminateStopColor2,
|
|
102
|
+
},
|
|
103
|
+
'linearGradient > stop:nth-child(3)': {
|
|
104
|
+
stopColor: illuminateStopColor3,
|
|
105
|
+
},
|
|
106
|
+
'linearGradient > stop:nth-child(4)': {
|
|
107
|
+
stopColor: illuminateStopColor4,
|
|
108
|
+
},
|
|
109
|
+
'linearGradient > stop:nth-child(5)': {
|
|
110
|
+
stopColor: illuminateStopColor5,
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
toggled: {
|
|
117
|
+
true: {
|
|
118
|
+
[buttonStencil.vars.background]: system.color.bg.default,
|
|
119
|
+
transition: 'box-shadow 300ms ease-out, background 300ms ease-out',
|
|
120
|
+
|
|
121
|
+
boxShadow: `0px 0px 4.9px 0px ${glowEraser}, 0px 0px 0.98px 0px ${glowHighlighter}, 0px 0px 1.96px 0px ${glowLunchBreak}, 0px 0px 2.94px 0px ${glowLunchBreak}, 0px 0px 4.9px 0px ${glowHappyHour}, 0px 0px 7.36px 0px ${glowThumbtack}, 0px 0px 9.81px 0px ${glowEraser}, 0px 0px 12.26px 0px rgba(255, 194, 253, 0.50)`,
|
|
122
|
+
'.wd-icon-ai-assistant-ingress-button': {
|
|
123
|
+
'.wd-icon-fill': {
|
|
124
|
+
transition: 'fill 300ms ease-out',
|
|
125
|
+
},
|
|
126
|
+
'> linearGradient > stop': {
|
|
127
|
+
transition: '300ms ease-out',
|
|
128
|
+
stopColor: system.color.fg.ai,
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
'&:is(:focus-visible, .focus):not(:disabled, .disabled)': {
|
|
132
|
+
...focusRing({width: 2, separation: 2}),
|
|
133
|
+
border: `1px solid ${system.color.border.container} `,
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
false: {
|
|
137
|
+
transition: 'box-shadow 300ms ease-out, background 300ms ease-out',
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
compound: [
|
|
142
|
+
{
|
|
143
|
+
modifiers: {toggled: 'true', variant: 'inverse'},
|
|
144
|
+
styles: {
|
|
145
|
+
[buttonStencil.vars.background]: system.color.bg.ai.strongest,
|
|
146
|
+
'.wd-icon-ai-assistant-ingress-button': {
|
|
147
|
+
'.wd-icon-fill': {
|
|
148
|
+
transition: 'fill 300ms ease-out',
|
|
149
|
+
},
|
|
150
|
+
'> linearGradient > stop': {
|
|
151
|
+
transition: '300ms ease-out',
|
|
152
|
+
stopColor: system.color.fg.inverse,
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
export const AiAssistantIngressButton = createComponent('button')({
|
|
161
|
+
displayName: 'AiAssistantIngressButton',
|
|
162
|
+
Component: ({toggled, variant, ...elemProps}: AiAssistantIngressButtonProps, ref, Element) => {
|
|
163
|
+
const svgGradientId = useUniqueId();
|
|
164
|
+
return (
|
|
165
|
+
<BaseButton
|
|
166
|
+
ref={ref}
|
|
167
|
+
as={Element}
|
|
168
|
+
{...handleCsProp(elemProps, [
|
|
169
|
+
aiAssistantIngressButtonStencil({toggled, variant}),
|
|
170
|
+
{
|
|
171
|
+
[systemIconStencil.vars.color]: `url(#${svgGradientId})`,
|
|
172
|
+
},
|
|
173
|
+
])}
|
|
174
|
+
>
|
|
175
|
+
<BaseButton.Icon size="large" icon={getAiAssistantIngressIcon(svgGradientId)} />
|
|
176
|
+
</BaseButton>
|
|
177
|
+
);
|
|
178
|
+
},
|
|
179
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {CanvasSystemIcon, CanvasIconTypes} from '@workday/design-assets-types';
|
|
2
|
+
|
|
3
|
+
export const getAiAssistantIngressIcon = (svgId: string): CanvasSystemIcon => {
|
|
4
|
+
return {
|
|
5
|
+
name: 'aiAssistantIngressButton',
|
|
6
|
+
type: CanvasIconTypes.System,
|
|
7
|
+
svg: `<svg class="wd-icon-ai-assistant-ingress-button" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" >
|
|
8
|
+
<linearGradient id="${svgId}" x1="10" y1="0.000195292" x2="10" y2="19.9998" gradientUnits="userSpaceOnUse">
|
|
9
|
+
<stop />
|
|
10
|
+
<stop offset="0.25"/>
|
|
11
|
+
<stop offset="0.5"/>
|
|
12
|
+
<stop offset="0.75"/>
|
|
13
|
+
<stop offset="1"/>
|
|
14
|
+
</linearGradient>
|
|
15
|
+
<path class="wd-icon-fill wd-icon-ai-assistant-ingress-button-bubble" d="M12 2.50003C12 2.22388 11.7759 1.9987 11.5001 2.01228C6.20948 2.27276 2 6.64479 2 12C2 13.5872 2.37077 15.1224 3.07103 16.507L2.44426 20.1925C2.42673 20.2956 2.42475 20.4007 2.43839 20.5044C2.51377 21.0776 3.03949 21.4811 3.61261 21.4057L7.44041 20.9022C8.83856 21.6197 10.3926 22 12 22C17.3552 22 21.7272 17.7905 21.9877 12.4999C22.0013 12.2241 21.7761 12 21.5 12H20.5C20.2239 12 20.0016 12.2245 19.9846 12.5001C19.7265 16.6854 16.2503 20 12 20C10.6368 20 9.32467 19.6593 8.15684 19.0183L7.92724 18.8923L4.53906 19.3379L5.09721 16.0559L4.96511 15.8128C4.33477 14.6524 4 13.3513 4 12C4 7.74968 7.31459 4.27352 11.4999 4.01538C11.7755 3.99838 12 3.77614 12 3.49999C12 3.1321 12 2.82183 12 2.50003Z" />
|
|
16
|
+
<path class="wd-icon-fill wd-icon-ai-assistant-ingress-button-sparkle" fill-rule="evenodd" clip-rule="evenodd" d="M17.5 2C17.6811 2 17.9069 2.1126 17.9555 2.37114C18.1407 3.35885 18.5381 4.1853 19.1401 4.809C19.7409 5.43146 20.5606 5.86796 21.6189 6.05318C22.1279 6.14203 22.1262 6.85808 21.6189 6.94681C20.5606 7.13204 19.7409 7.56853 19.1401 8.191C18.5381 8.8147 18.1408 9.64103 17.9556 10.6287C17.907 10.8873 17.6811 11 17.5 11C17.3189 11 17.0931 10.8874 17.0445 10.6289C16.8593 9.64115 16.4619 8.81474 15.8599 8.19106C15.2592 7.56861 14.4394 7.13211 13.3811 6.94681C12.8721 6.85795 12.8739 6.14192 13.3811 6.05318C14.4394 5.86796 15.2591 5.43146 15.8599 4.809C16.4619 4.1853 16.8592 3.35897 17.0444 2.37126C17.093 2.11272 17.3189 2 17.5 2Z" />
|
|
17
|
+
</svg>`,
|
|
18
|
+
filename: 'wd-icon-ai-assistant-ingress-button.svg',
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../ai-assistant-ingress-button/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./lib/AiAssistantIngressButton"), exports);
|
|
18
|
+
__exportStar(require("./lib/AiAssistantIngressIcon"), exports);
|