@workday/canvas-kit-docs 13.0.0-alpha.1072-next.0 → 13.0.0-alpha.1075-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/dist/es6/lib/ExampleCodeBlock.d.ts +1 -2
- package/dist/es6/lib/ExampleCodeBlock.d.ts.map +1 -1
- package/dist/es6/lib/ExampleCodeBlock.js +7 -18
- package/dist/es6/lib/MDXElements.d.ts +1 -2
- package/dist/es6/lib/MDXElements.d.ts.map +1 -1
- package/dist/es6/lib/MDXElements.js +4 -4
- package/dist/es6/lib/MoreTooltip.d.ts +1 -1
- package/dist/es6/lib/MoreTooltip.d.ts.map +1 -1
- package/dist/es6/lib/MoreTooltip.js +11 -12
- package/dist/es6/lib/Specifications.d.ts +1 -2
- package/dist/es6/lib/Specifications.d.ts.map +1 -1
- package/dist/es6/lib/Specifications.js +3 -20
- package/dist/es6/lib/StylePropsTable.d.ts +1 -2
- package/dist/es6/lib/StylePropsTable.d.ts.map +1 -1
- package/dist/es6/lib/StylePropsTable.js +6 -16
- package/dist/es6/lib/Table.d.ts.map +1 -1
- package/dist/es6/lib/Table.js +7 -7
- package/dist/es6/lib/Value.d.ts +3 -3
- package/dist/es6/lib/Value.d.ts.map +1 -1
- package/dist/es6/lib/Value.js +16 -51
- package/dist/es6/lib/docs.js +174 -181
- package/dist/es6/lib/stackblitzFiles/App.d.ts +1 -2
- package/dist/es6/lib/stackblitzFiles/App.d.ts.map +1 -1
- package/dist/es6/lib/stackblitzFiles/App.js +2 -5
- package/dist/es6/lib/stackblitzFiles/App.tsx +0 -1
- package/dist/es6/lib/stackblitzFiles/Demo.d.ts +1 -2
- package/dist/es6/lib/stackblitzFiles/Demo.d.ts.map +1 -1
- package/dist/es6/lib/stackblitzFiles/Demo.js +2 -2
- package/dist/es6/lib/stackblitzFiles/Demo.tsx +0 -2
- package/dist/es6/lib/stackblitzFiles/main.d.ts.map +1 -1
- package/dist/es6/lib/stackblitzFiles/main.js +2 -2
- package/dist/es6/lib/stackblitzFiles/main.tsx +0 -1
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.js +5 -5
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.ts +5 -5
- package/dist/es6/lib/widgetUtils.d.ts +5 -5
- package/dist/es6/lib/widgetUtils.d.ts.map +1 -1
- package/dist/es6/lib/widgetUtils.js +25 -54
- package/dist/es6/lib/widgets/array.js +2 -4
- package/dist/es6/lib/widgets/callExpression.js +2 -14
- package/dist/es6/lib/widgets/canvasColor.js +2 -2
- package/dist/es6/lib/widgets/component.js +2 -4
- package/dist/es6/lib/widgets/conditional.js +2 -12
- package/dist/es6/lib/widgets/enhancedComponent.js +14 -66
- package/dist/es6/lib/widgets/external.js +2 -4
- package/dist/es6/lib/widgets/function.js +7 -26
- package/dist/es6/lib/widgets/intersection.js +2 -3
- package/dist/es6/lib/widgets/model.js +3 -19
- package/dist/es6/lib/widgets/object.js +2 -2
- package/dist/es6/lib/widgets/parenthesis.js +2 -5
- package/dist/es6/lib/widgets/primitives.js +9 -27
- package/dist/es6/lib/widgets/qualifiedName.js +2 -5
- package/dist/es6/lib/widgets/symbol.js +2 -2
- package/dist/es6/lib/widgets/tuple.js +2 -5
- package/dist/es6/lib/widgets/typeParameter.js +2 -13
- package/dist/es6/lib/widgets/union.js +4 -10
- package/dist/es6/mdx/installBlock.d.ts +1 -2
- package/dist/es6/mdx/installBlock.d.ts.map +1 -1
- package/dist/es6/mdx/installBlock.js +2 -6
- package/dist/es6/mdx/style-props/examples/Background.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Background.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Background.js +2 -5
- package/dist/es6/mdx/style-props/examples/Border.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Border.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Border.js +2 -5
- package/dist/es6/mdx/style-props/examples/Color.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Color.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Color.js +2 -5
- package/dist/es6/mdx/style-props/examples/Depth.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Depth.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Depth.js +2 -5
- package/dist/es6/mdx/style-props/examples/Flex.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Flex.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Flex.js +2 -14
- package/dist/es6/mdx/style-props/examples/FlexItem.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/FlexItem.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/FlexItem.js +2 -13
- package/dist/es6/mdx/style-props/examples/Grid.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Grid.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Grid.js +2 -6
- package/dist/es6/mdx/style-props/examples/GridItem.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/GridItem.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/GridItem.js +2 -6
- package/dist/es6/mdx/style-props/examples/Layout.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Layout.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Layout.js +2 -5
- package/dist/es6/mdx/style-props/examples/Other.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Other.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Other.js +2 -5
- package/dist/es6/mdx/style-props/examples/Position.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Position.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Position.js +2 -5
- package/dist/es6/mdx/style-props/examples/Space.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Space.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Space.js +2 -8
- package/dist/es6/mdx/style-props/examples/Text.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Text.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Text.js +2 -5
- package/dist/es6/mdx/versionsTable.d.ts +1 -2
- package/dist/es6/mdx/versionsTable.d.ts.map +1 -1
- package/dist/es6/mdx/versionsTable.js +8 -21
- package/dist/es6/mdx/welcomePage.d.ts +1 -2
- package/dist/es6/mdx/welcomePage.d.ts.map +1 -1
- package/dist/es6/mdx/welcomePage.js +2 -38
- package/dist/mdx/13.0-UPGRADE-GUIDE.mdx +67 -3
- package/dist/mdx/labs-react/expandable/examples/Avatar.tsx +0 -2
- package/dist/mdx/labs-react/expandable/examples/Depth.tsx +0 -2
- package/dist/mdx/labs-react/expandable/examples/EndIcon.tsx +0 -2
- package/dist/mdx/labs-react/expandable/examples/LongTitle.tsx +0 -2
- package/dist/mdx/labs-react/expandable/examples/RTL.tsx +0 -2
- package/dist/mdx/labs-react/expandable/examples/StartIcon.tsx +0 -2
- package/dist/mdx/preview-react/information-highlight/examples/Caution.tsx +0 -1
- package/dist/mdx/preview-react/information-highlight/examples/Critical.tsx +0 -1
- package/dist/mdx/preview-react/information-highlight/examples/Informational.tsx +0 -1
- package/dist/mdx/preview-react/pill/examples/WithReadOnly.tsx +0 -2
- package/dist/mdx/preview-react/segmented-control/examples/Disabled.tsx +0 -1
- package/dist/mdx/preview-react/segmented-control/examples/RTL.tsx +0 -1
- package/dist/mdx/preview-react/segmented-control/examples/Vertical.tsx +0 -1
- package/dist/mdx/preview-react/select/examples/Top Label/Alert.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/Default.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/DefaultWithCustomOptions.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/DefaultWithSimpleOptions.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/Disabled.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/Error.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/Grow.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/Scrollable.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/storiesData.tsx +0 -1
- package/dist/mdx/preview-react/text-area/examples/Alert.tsx +1 -4
- package/dist/mdx/preview-react/text-input/examples/Alert.tsx +1 -4
- package/dist/mdx/preview-react/text-input/examples/ThemedAlert.tsx +1 -4
- package/dist/mdx/react/action-bar/examples/Basic.tsx +0 -1
- package/dist/mdx/react/action-bar/examples/DeleteAction.tsx +0 -2
- package/dist/mdx/react/action-bar/examples/Icons.tsx +0 -2
- package/dist/mdx/react/avatar/avatar/examples/Basic.tsx +0 -1
- package/dist/mdx/react/avatar/avatar/examples/Button.tsx +0 -1
- package/dist/mdx/react/avatar/avatar/examples/CustomStyles.tsx +0 -1
- package/dist/mdx/react/avatar/avatar/examples/Image.tsx +0 -1
- package/dist/mdx/react/avatar/avatar/examples/LazyLoad.tsx +0 -1
- package/dist/mdx/react/avatar/avatar/examples/ObjectFit.tsx +0 -1
- package/dist/mdx/react/avatar/avatar/examples/Size.tsx +0 -1
- package/dist/mdx/react/avatar/avatar/examples/Variant.tsx +0 -1
- package/dist/mdx/react/banner/examples/Error.tsx +0 -2
- package/dist/mdx/react/banner/examples/Sticky.tsx +0 -1
- package/dist/mdx/react/banner/examples/StickyAnimation.tsx +42 -26
- package/dist/mdx/react/breadcrumbs/examples/Basic.tsx +0 -1
- package/dist/mdx/react/button/button/examples/Delete.tsx +0 -2
- package/dist/mdx/react/button/button/examples/ExternalHyperlink.tsx +0 -2
- package/dist/mdx/react/button/button/examples/Hyperlink.tsx +0 -2
- package/dist/mdx/react/button/button/examples/Primary.tsx +0 -2
- package/dist/mdx/react/color-picker/color-preview/examples/Basic.tsx +0 -1
- package/dist/mdx/react/dialog/examples/DialogWithFallbackPlacements.tsx +0 -1
- package/dist/mdx/react/modal/examples/Basic.tsx +0 -2
- package/dist/mdx/react/modal/examples/IframeTest.tsx +0 -1
- package/dist/mdx/react/modal/examples/ModalWithPopup.tsx +0 -1
- package/dist/mdx/react/modal/examples/StackedModals.tsx +0 -1
- package/dist/mdx/react/pagination/examples/CustomRange.tsx +0 -1
- package/dist/mdx/react/pagination/examples/GoToForm.tsx +0 -1
- package/dist/mdx/react/pagination/examples/JumpControls.tsx +0 -1
- package/dist/mdx/react/popup/examples/Basic.tsx +0 -2
- package/dist/mdx/react/popup/examples/CloseOnTargetHiddenTest.tsx +0 -1
- package/dist/mdx/react/popup/examples/ComboboxWithinPopup.tsx +0 -1
- package/dist/mdx/react/popup/examples/MultiplePopups.tsx +0 -2
- package/dist/mdx/react/popup/examples/PopupWithFallbackPlacements.tsx +0 -1
- package/dist/mdx/react/popup/examples/PopupWithNonHidablePopup.tsx +0 -1
- package/dist/mdx/react/popup/examples/ReturnFocusTest.tsx +0 -2
- package/dist/mdx/react/popup/examples/TooltipReturnFocus.tsx +0 -1
- package/dist/mdx/react/select/examples/MenuHeight.tsx +0 -1
- package/dist/mdx/react/tabs/examples/Basic.tsx +0 -1
- package/dist/mdx/react/tabs/examples/DisabledTab.tsx +0 -1
- package/dist/mdx/react/tabs/examples/NamedTabs.tsx +0 -1
- package/dist/mdx/react/tabs/examples/RightToLeft.tsx +0 -1
- package/dist/mdx/react/text-input/examples/Basic.tsx +0 -3
- package/dist/mdx/react/toast/examples/Basic.tsx +0 -2
- package/dist/mdx/react/toast/examples/ToastAlert.tsx +0 -2
- package/dist/mdx/react/toast/examples/ToastDialog.tsx +0 -2
- package/dist/mdx/react/tooltip/examples/Default.tsx +0 -2
- package/dist/mdx/react/tooltip/examples/DescribeType.tsx +0 -2
- package/dist/mdx/react/tooltip/examples/DescriptionType.tsx +0 -2
- package/dist/mdx/react/tooltip/examples/Muted.tsx +0 -2
- package/dist/mdx/style-props/examples/Background.tsx +0 -1
- package/dist/mdx/style-props/examples/Border.tsx +0 -1
- package/dist/mdx/style-props/examples/Color.tsx +0 -1
- package/dist/mdx/style-props/examples/Depth.tsx +0 -1
- package/dist/mdx/style-props/examples/Flex.tsx +0 -1
- package/dist/mdx/style-props/examples/FlexItem.tsx +0 -1
- package/dist/mdx/style-props/examples/Grid.tsx +0 -1
- package/dist/mdx/style-props/examples/GridItem.tsx +0 -1
- package/dist/mdx/style-props/examples/Layout.tsx +0 -1
- package/dist/mdx/style-props/examples/Other.tsx +0 -1
- package/dist/mdx/style-props/examples/Position.tsx +0 -1
- package/dist/mdx/style-props/examples/Space.tsx +0 -1
- package/dist/mdx/style-props/examples/Text.tsx +0 -1
- package/lib/StylePropsTable.tsx +0 -1
- package/lib/Table.tsx +0 -1
- package/lib/stackblitzFiles/App.tsx +0 -1
- package/lib/stackblitzFiles/Demo.tsx +0 -2
- package/lib/stackblitzFiles/main.tsx +0 -1
- package/lib/widgets/array.tsx +0 -2
- package/lib/widgets/canvasColor.tsx +0 -2
- package/lib/widgets/component.tsx +0 -2
- package/lib/widgets/conditional.tsx +0 -2
- package/lib/widgets/external.tsx +0 -1
- package/lib/widgets/model.tsx +0 -2
- package/lib/widgets/parenthesis.tsx +0 -2
- package/lib/widgets/primitives.tsx +1 -5
- package/lib/widgets/qualifiedName.tsx +0 -2
- package/lib/widgets/symbol.tsx +0 -2
- package/lib/widgets/tuple.tsx +0 -2
- package/lib/widgets/typeParameter.tsx +0 -2
- package/package.json +6 -6
|
@@ -21,6 +21,10 @@ any questions.
|
|
|
21
21
|
- [External Hyperlink](#external-hyperlink)
|
|
22
22
|
- [Pill](#pill)
|
|
23
23
|
- [Tabs](#tabs)
|
|
24
|
+
- [Brand Refresh](#brand-refresh)
|
|
25
|
+
- [Logo Updates](#logo-updates)
|
|
26
|
+
- [Infrastructure](#infrastructure)
|
|
27
|
+
- [Supporting react-jsx](#supoorting-react-jsx)
|
|
24
28
|
- [Troubleshooting](#troubleshooting)
|
|
25
29
|
- [Glossary](#glossary)
|
|
26
30
|
- [Main](#main)
|
|
@@ -116,7 +120,7 @@ The following components are affected:
|
|
|
116
120
|
- `Tabs`
|
|
117
121
|
- `Tooltip`
|
|
118
122
|
|
|
119
|
-
|
|
123
|
+
### External Hyperlink
|
|
120
124
|
|
|
121
125
|
**PR:** [#3101](https://github.com/Workday/canvas-kit/pull/3101)
|
|
122
126
|
|
|
@@ -134,7 +138,7 @@ The following components are affected:
|
|
|
134
138
|
</ExternalHyperlink>
|
|
135
139
|
```
|
|
136
140
|
|
|
137
|
-
|
|
141
|
+
### Pill
|
|
138
142
|
|
|
139
143
|
**PRs:** [#3104](https://github.com/Workday/canvas-kit/pull/3104)
|
|
140
144
|
|
|
@@ -150,7 +154,7 @@ A few changes have been made to `Pill` to ensure proper accessibility and styles
|
|
|
150
154
|
- `<Pill.IconButton/>` no longer has a default `aria-label="remove"`. You *must* provide an `aria-label` for `<Pill.IconButton/>` to ensure proper accessibility. Our examples have been updated to reflect this change.
|
|
151
155
|
- `<Pill.Label/>` is a *required* element when using other sub-components like `<Pill.Icon/>` to ensure that the label truncates correctly.
|
|
152
156
|
|
|
153
|
-
|
|
157
|
+
### Tabs
|
|
154
158
|
|
|
155
159
|
**PR:** [#3119](https://github.com/Workday/canvas-kit/pull/3119)
|
|
156
160
|
|
|
@@ -158,6 +162,66 @@ A few changes have been made to `Pill` to ensure proper accessibility and styles
|
|
|
158
162
|
|
|
159
163
|
**Note:** There should be no developer impact and the visual changes are safe to accept.
|
|
160
164
|
|
|
165
|
+
## Brand Refresh
|
|
166
|
+
|
|
167
|
+
### Logo Updates
|
|
168
|
+
|
|
169
|
+
We've removed the outdated Dub Logos in Main and promoted the new logos that were previously in our Preview package to Main as part of the brand refresh.
|
|
170
|
+
|
|
171
|
+
| Old Logo Name | New Logo Name |
|
|
172
|
+
| --------------- | ----------------- |
|
|
173
|
+
| dubLogoBlue | dubLogoPrimary |
|
|
174
|
+
| dubLogoWhite | dubLogoReversed |
|
|
175
|
+
| wdayLogoBlue | wdayLogoPrimary |
|
|
176
|
+
| wdayLogoWhite | wdayLogoReversed |
|
|
177
|
+
|
|
178
|
+
```tsx
|
|
179
|
+
// In v12
|
|
180
|
+
// Importing from Main common
|
|
181
|
+
import {dubLogoBlue} from "@workday/canvas-kit-react/common"
|
|
182
|
+
|
|
183
|
+
<div dangerouslySetInnerHTML={__html: dubLogoBlue} />
|
|
184
|
+
|
|
185
|
+
// Importing from Preview common
|
|
186
|
+
import {dubLogoPrimary} from "@workday/canvas-kit-preview-react/common"
|
|
187
|
+
|
|
188
|
+
<div dangerouslySetInnerHTML={__html: dubLogoPrimary} />
|
|
189
|
+
|
|
190
|
+
// In v13
|
|
191
|
+
// New logos have been promoted to Main common AND renamed
|
|
192
|
+
import {dubLogoPrimary} from "@workday/canvas-kit-preview-react/common"
|
|
193
|
+
|
|
194
|
+
<div dangerouslySetInnerHTML={__html: dubLogoPrimary} />
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
🤖 The codemod will handle the change of `'dubLogoBlue', 'dubLogoWhite', 'wdayLogoBlue', 'wdayLogoWhite'` to
|
|
198
|
+
`'dubLogoPrimary', 'dubLogoReversed', 'wdayLogoPrimary', 'wdayLogoReversed'` as shown above in the table. It will also handle
|
|
199
|
+
updating your imports.
|
|
200
|
+
|
|
201
|
+
From:
|
|
202
|
+
```tsx
|
|
203
|
+
import {dubLogoBlue} from "@workday/canvas-kit-react/common"
|
|
204
|
+
```
|
|
205
|
+
To:
|
|
206
|
+
```tsx
|
|
207
|
+
import {dubLogoPrimary} from "@workday/canvas-kit-react/common"
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
## Infrastructure
|
|
212
|
+
|
|
213
|
+
### Supporting `react-jsx`
|
|
214
|
+
|
|
215
|
+
We've updated the `jsx` flag in our `tsconfig` to `react-jsx`. As part of this change, we've also updated our peer dependencies for our packages to a minimum version of `react@17.0.0`. This change is to provide support for modern technologies like `vite` and ES modules.
|
|
216
|
+
|
|
217
|
+
##### Breaking Changes
|
|
218
|
+
|
|
219
|
+
If you're using `react@16.x.x`, you'll need to upgrade to `react@17.x.x` to use Canvas Kit v13.
|
|
220
|
+
|
|
221
|
+
>**Note:** You'll need to update the way `jsx` transpiles. The automatic runtime feature, enabled through the `@babel/preset-react` preset with the `runtime: "automatic"` option, handles the importing of functions that JSX transpiles to.
|
|
222
|
+
|
|
223
|
+
```sh
|
|
224
|
+
|
|
161
225
|
## Troubleshooting
|
|
162
226
|
|
|
163
227
|
## Glossary
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/** @jsxRuntime classic */
|
|
2
|
-
/** @jsx jsx */
|
|
3
|
-
import {jsx} from '@emotion/react';
|
|
4
1
|
import React from 'react';
|
|
5
2
|
import {TextArea} from '@workday/canvas-kit-preview-react/text-area';
|
|
6
3
|
import {useThemedRing} from '@workday/canvas-kit-react/common';
|
|
@@ -28,7 +25,7 @@ export default () => {
|
|
|
28
25
|
return (
|
|
29
26
|
<TextArea orientation="vertical">
|
|
30
27
|
<TextArea.Label>Add a comment</TextArea.Label>
|
|
31
|
-
<TextArea.Field
|
|
28
|
+
<TextArea.Field cs={alertStyles} onChange={handleChange} value={value} />
|
|
32
29
|
<TextArea.Hint paddingTop={space.xxs}>
|
|
33
30
|
<strong>Character Limit: </strong>
|
|
34
31
|
<Text color={hintColor}>{10 - value.length} Left</Text>
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/** @jsxRuntime classic */
|
|
2
|
-
/** @jsx jsx */
|
|
3
|
-
import {jsx} from '@emotion/react';
|
|
4
1
|
import React from 'react';
|
|
5
2
|
import {TextInput} from '@workday/canvas-kit-preview-react/text-input';
|
|
6
3
|
import {useThemedRing} from '@workday/canvas-kit-react/common';
|
|
@@ -20,7 +17,7 @@ export default () => {
|
|
|
20
17
|
return (
|
|
21
18
|
<TextInput orientation="vertical">
|
|
22
19
|
<TextInput.Label>Password</TextInput.Label>
|
|
23
|
-
<TextInput.Field
|
|
20
|
+
<TextInput.Field cs={alertStyles} onChange={handleChange} value={value} type="password" />
|
|
24
21
|
<TextInput.Hint paddingTop={space.xxs}>
|
|
25
22
|
<strong>Password Strength: </strong>
|
|
26
23
|
{value.length < 3 ? (
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/** @jsxRuntime classic */
|
|
2
|
-
/** @jsx jsx */
|
|
3
|
-
import {jsx} from '@emotion/react';
|
|
4
1
|
import React from 'react';
|
|
5
2
|
import {TextInput} from '@workday/canvas-kit-preview-react/text-input';
|
|
6
3
|
import {
|
|
@@ -43,7 +40,7 @@ const AlertInput = () => {
|
|
|
43
40
|
return (
|
|
44
41
|
<TextInput orientation="vertical">
|
|
45
42
|
<TextInput.Label>Email</TextInput.Label>
|
|
46
|
-
<TextInput.Field
|
|
43
|
+
<TextInput.Field cs={alertStyles} onChange={handleChange} value={value} />
|
|
47
44
|
<TextInput.Hint paddingTop={space.xxs}>Please enter a valid email.</TextInput.Hint>
|
|
48
45
|
</TextInput>
|
|
49
46
|
);
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/** @jsxRuntime classic */
|
|
2
|
-
/** @jsx jsx */
|
|
3
|
-
import {jsx, keyframes} from '@emotion/react';
|
|
4
1
|
import React from 'react';
|
|
5
2
|
|
|
6
3
|
import {CSSProperties, space} from '@workday/canvas-kit-react/tokens';
|
|
@@ -8,47 +5,66 @@ import {useTheme} from '@workday/canvas-kit-react/common';
|
|
|
8
5
|
import {Box} from '@workday/canvas-kit-react/layout';
|
|
9
6
|
import {loopIcon} from '@workday/canvas-system-icons-web';
|
|
10
7
|
import {Banner} from '@workday/canvas-kit-react/banner';
|
|
8
|
+
import {
|
|
9
|
+
createStencil,
|
|
10
|
+
createStyles,
|
|
11
|
+
createVars,
|
|
12
|
+
keyframes,
|
|
13
|
+
handleCsProp,
|
|
14
|
+
cssVar,
|
|
15
|
+
} from '@workday/canvas-kit-styling';
|
|
16
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
11
17
|
|
|
12
|
-
const containerStyles
|
|
18
|
+
const containerStyles = createStyles({
|
|
13
19
|
position: 'absolute',
|
|
14
20
|
right: 0,
|
|
15
21
|
overflow: 'hidden',
|
|
16
|
-
};
|
|
22
|
+
});
|
|
23
|
+
const stickyAnimationVars = createVars('width', 'rerun');
|
|
24
|
+
const stickAnimationKeyframes = keyframes({
|
|
25
|
+
'0%': {
|
|
26
|
+
transform: `translateX(${cssVar(stickyAnimationVars.width)})`,
|
|
27
|
+
},
|
|
28
|
+
'100%': {
|
|
29
|
+
transform: `translateX(0 * ${cssVar(stickyAnimationVars.rerun)})`,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const stickyAnimationStencil = createStencil({
|
|
34
|
+
base: {
|
|
35
|
+
marginY: system.space.x1,
|
|
36
|
+
marginInlineStart: system.space.x1,
|
|
37
|
+
marginInlineEnd: 0,
|
|
38
|
+
animationName: stickAnimationKeyframes,
|
|
39
|
+
animationDuration: '.3s',
|
|
40
|
+
animationTimingFunction: 'ease-out',
|
|
41
|
+
},
|
|
42
|
+
});
|
|
17
43
|
|
|
18
44
|
export default () => {
|
|
19
45
|
const theme = useTheme();
|
|
20
46
|
const bannerRef = React.useRef<HTMLButtonElement>(null);
|
|
21
47
|
const containerRef = React.useRef<HTMLDivElement>(null);
|
|
22
48
|
const [styles, setStyles] = React.useState<CSSProperties>();
|
|
49
|
+
const [bannerWidth, setBannerWidth] = React.useState(0);
|
|
23
50
|
|
|
24
51
|
const [rerun, setRerun] = React.useState(1); // Only needed for demo purposes
|
|
25
52
|
|
|
26
53
|
React.useLayoutEffect(() => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
width *= -1;
|
|
30
|
-
}
|
|
31
|
-
const slideInKeyframes = keyframes({
|
|
32
|
-
'0%': {
|
|
33
|
-
transform: `translateX(${width}px)`,
|
|
34
|
-
},
|
|
35
|
-
'100%': {
|
|
36
|
-
transform: `translateX(0 * ${rerun})`,
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
setStyles({
|
|
41
|
-
marginY: space.xxxs,
|
|
42
|
-
marginInlineStart: space.xxxs,
|
|
43
|
-
maringInlineEnd: 0,
|
|
44
|
-
animation: `${slideInKeyframes} .3s ease-out forwards`,
|
|
45
|
-
});
|
|
54
|
+
const width = bannerRef.current.offsetWidth;
|
|
55
|
+
setBannerWidth(theme.canvas.direction === 'rtl' ? width * -1 : width);
|
|
46
56
|
}, [theme.canvas.direction, rerun]);
|
|
47
57
|
|
|
48
58
|
return (
|
|
49
59
|
<Box height={64}>
|
|
50
|
-
<div
|
|
51
|
-
<div
|
|
60
|
+
<div className={containerStyles} ref={containerRef}>
|
|
61
|
+
<div
|
|
62
|
+
key={rerun}
|
|
63
|
+
{...handleCsProp({}, [
|
|
64
|
+
stickyAnimationStencil(),
|
|
65
|
+
stickyAnimationVars({width: `${bannerWidth}px`, rerun: `${rerun}`}),
|
|
66
|
+
])}
|
|
67
|
+
>
|
|
52
68
|
<Banner
|
|
53
69
|
onClick={() => setRerun(r => r + 1)}
|
|
54
70
|
hasError={true}
|