@workday/canvas-kit-preview-react 9.0.0-alpha.336-next.6 → 9.0.0-alpha.344-next.3
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/commonjs/form-field/lib/FormField.d.ts +2 -2
- package/dist/commonjs/form-field/lib/FormFieldHint.d.ts +1 -1
- package/dist/commonjs/form-field/lib/FormFieldInput.d.ts +1 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.d.ts +1 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.d.ts +1 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.d.ts +1 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts +2 -12
- package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.js +1 -3
- package/dist/commonjs/menu/lib/Menu.d.ts +12 -5
- package/dist/commonjs/menu/lib/Menu.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/Menu.js +14 -5
- package/dist/commonjs/menu/lib/MenuItem.d.ts +15 -5
- package/dist/commonjs/menu/lib/MenuItem.d.ts.map +1 -1
- package/dist/commonjs/menu/lib/MenuItem.js +18 -6
- package/dist/commonjs/pill/lib/Pill.d.ts +103 -5
- package/dist/commonjs/pill/lib/Pill.d.ts.map +1 -1
- package/dist/commonjs/pill/lib/Pill.js +101 -2
- package/dist/commonjs/segmented-control/index.d.ts +2 -0
- package/dist/commonjs/segmented-control/index.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/index.js +4 -0
- package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts +74 -38
- package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControl.js +36 -0
- package/dist/commonjs/segmented-control/lib/SegmentedControlItem.d.ts +1 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.d.ts +64 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControlList.js +3 -3
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.d.ts +2 -2
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.d.ts +39 -39
- package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.js +2 -1
- package/dist/commonjs/select/lib/Select.js +2 -0
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts +13 -26
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/SidePanel.js +73 -96
- package/dist/commonjs/side-panel/lib/SidePanelToggleButton.d.ts +17 -0
- package/dist/commonjs/side-panel/lib/SidePanelToggleButton.d.ts.map +1 -0
- package/dist/commonjs/side-panel/lib/SidePanelToggleButton.js +88 -0
- package/dist/commonjs/side-panel/lib/hooks.d.ts +20 -0
- package/dist/commonjs/side-panel/lib/hooks.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/hooks.js +20 -1
- package/dist/commonjs/status-indicator/index.d.ts +2 -0
- package/dist/commonjs/status-indicator/index.d.ts.map +1 -1
- package/dist/commonjs/status-indicator/index.js +4 -0
- package/dist/commonjs/status-indicator/lib/StatusIndicator.d.ts +28 -2
- package/dist/commonjs/status-indicator/lib/StatusIndicator.d.ts.map +1 -1
- package/dist/commonjs/status-indicator/lib/StatusIndicator.js +27 -1
- package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.d.ts +13 -0
- package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.d.ts.map +1 -1
- package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.js +3 -3
- package/dist/commonjs/text-area/lib/TextArea.d.ts +1 -1
- package/dist/commonjs/text-area/lib/TextArea.d.ts.map +1 -1
- package/dist/commonjs/text-area/lib/TextArea.js +1 -2
- package/dist/commonjs/text-input/lib/TextInput.d.ts +2 -2
- package/dist/commonjs/text-input/lib/TextInput.d.ts.map +1 -1
- package/dist/commonjs/text-input/lib/TextInput.js +1 -2
- package/dist/commonjs/text-input/lib/TextInputField.js +1 -1
- package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +1 -1
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +1 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -1
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.js +1 -0
- package/dist/es6/form-field/lib/FormField.d.ts +2 -2
- package/dist/es6/form-field/lib/FormFieldHint.d.ts +1 -1
- package/dist/es6/form-field/lib/FormFieldInput.d.ts +1 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldHint.d.ts +1 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldInput.d.ts +1 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldLabel.d.ts +1 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts +2 -12
- package/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts.map +1 -1
- package/dist/es6/form-field/lib/hooks/useFormFieldModel.js +1 -3
- package/dist/es6/menu/lib/Menu.d.ts +12 -5
- package/dist/es6/menu/lib/Menu.d.ts.map +1 -1
- package/dist/es6/menu/lib/Menu.js +14 -5
- package/dist/es6/menu/lib/MenuItem.d.ts +15 -5
- package/dist/es6/menu/lib/MenuItem.d.ts.map +1 -1
- package/dist/es6/menu/lib/MenuItem.js +18 -6
- package/dist/es6/pill/lib/Pill.d.ts +103 -5
- package/dist/es6/pill/lib/Pill.d.ts.map +1 -1
- package/dist/es6/pill/lib/Pill.js +101 -2
- package/dist/es6/segmented-control/index.d.ts +2 -0
- package/dist/es6/segmented-control/index.d.ts.map +1 -1
- package/dist/es6/segmented-control/index.js +2 -0
- package/dist/es6/segmented-control/lib/SegmentedControl.d.ts +74 -38
- package/dist/es6/segmented-control/lib/SegmentedControl.d.ts.map +1 -1
- package/dist/es6/segmented-control/lib/SegmentedControl.js +36 -0
- package/dist/es6/segmented-control/lib/SegmentedControlItem.d.ts +1 -1
- package/dist/es6/segmented-control/lib/SegmentedControlList.d.ts +64 -1
- package/dist/es6/segmented-control/lib/SegmentedControlList.d.ts.map +1 -1
- package/dist/es6/segmented-control/lib/SegmentedControlList.js +1 -1
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.d.ts +2 -2
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.d.ts +39 -39
- package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.js +2 -1
- package/dist/es6/select/lib/Select.js +2 -0
- package/dist/es6/side-panel/lib/SidePanel.d.ts +13 -26
- package/dist/es6/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/SidePanel.js +75 -97
- package/dist/es6/side-panel/lib/SidePanelToggleButton.d.ts +17 -0
- package/dist/es6/side-panel/lib/SidePanelToggleButton.d.ts.map +1 -0
- package/dist/es6/side-panel/lib/SidePanelToggleButton.js +66 -0
- package/dist/es6/side-panel/lib/hooks.d.ts +20 -0
- package/dist/es6/side-panel/lib/hooks.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/hooks.js +19 -0
- package/dist/es6/status-indicator/index.d.ts +2 -0
- package/dist/es6/status-indicator/index.d.ts.map +1 -1
- package/dist/es6/status-indicator/index.js +2 -0
- package/dist/es6/status-indicator/lib/StatusIndicator.d.ts +28 -2
- package/dist/es6/status-indicator/lib/StatusIndicator.d.ts.map +1 -1
- package/dist/es6/status-indicator/lib/StatusIndicator.js +27 -1
- package/dist/es6/status-indicator/lib/StatusIndicatorIcon.d.ts +13 -0
- package/dist/es6/status-indicator/lib/StatusIndicatorIcon.d.ts.map +1 -1
- package/dist/es6/status-indicator/lib/StatusIndicatorIcon.js +1 -1
- package/dist/es6/text-area/lib/TextArea.d.ts +1 -1
- package/dist/es6/text-area/lib/TextArea.d.ts.map +1 -1
- package/dist/es6/text-area/lib/TextArea.js +2 -3
- package/dist/es6/text-input/lib/TextInput.d.ts +2 -2
- package/dist/es6/text-input/lib/TextInput.d.ts.map +1 -1
- package/dist/es6/text-input/lib/TextInput.js +2 -3
- package/dist/es6/text-input/lib/TextInputField.js +3 -3
- package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +1 -1
- package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +1 -0
- package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -1
- package/dist/es6/text-input/lib/hooks/useTextInputModel.js +1 -0
- package/form-field/lib/hooks/useFormFieldModel.tsx +1 -3
- package/menu/lib/Menu.tsx +12 -5
- package/menu/lib/MenuItem.tsx +15 -5
- package/package.json +4 -4
- package/pill/lib/Pill.tsx +101 -2
- package/segmented-control/index.ts +2 -0
- package/segmented-control/lib/SegmentedControl.tsx +36 -0
- package/segmented-control/lib/SegmentedControlList.tsx +1 -1
- package/side-panel/lib/SidePanel.tsx +119 -169
- package/side-panel/lib/SidePanelToggleButton.tsx +78 -0
- package/side-panel/lib/hooks.ts +20 -0
- package/status-indicator/index.ts +2 -0
- package/status-indicator/lib/StatusIndicator.tsx +27 -1
- package/status-indicator/lib/StatusIndicatorIcon.tsx +1 -1
- package/text-area/lib/TextArea.tsx +6 -3
- package/text-input/lib/TextInput.tsx +6 -3
- package/text-input/lib/TextInputField.tsx +3 -3
- package/text-input/lib/hooks/useTextInputModel.ts +1 -0
- package/dist/commonjs/text-area/lib/hooks/index.d.ts +0 -2
- package/dist/commonjs/text-area/lib/hooks/index.d.ts.map +0 -1
- package/dist/commonjs/text-area/lib/hooks/index.js +0 -13
- package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.d.ts +0 -28
- package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.d.ts.map +0 -1
- package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.js +0 -5
- package/dist/es6/text-area/lib/hooks/index.d.ts +0 -2
- package/dist/es6/text-area/lib/hooks/index.d.ts.map +0 -1
- package/dist/es6/text-area/lib/hooks/index.js +0 -1
- package/dist/es6/text-area/lib/hooks/useTextAreaModel.d.ts +0 -28
- package/dist/es6/text-area/lib/hooks/useTextAreaModel.d.ts.map +0 -1
- package/dist/es6/text-area/lib/hooks/useTextAreaModel.js +0 -2
- package/text-area/lib/hooks/index.ts +0 -1
- package/text-area/lib/hooks/useTextAreaModel.ts +0 -3
|
@@ -2,7 +2,6 @@ export declare const useFormFieldModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
2
2
|
/**
|
|
3
3
|
* Optional flag to denote if this field has an error to display. When true the `FormField.Input` will have
|
|
4
4
|
* `required` set to true, and usually some subcomponents will have a error color applied.
|
|
5
|
-
* @default false
|
|
6
5
|
*/
|
|
7
6
|
hasError: boolean;
|
|
8
7
|
/**
|
|
@@ -13,13 +12,12 @@ export declare const useFormFieldModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
13
12
|
* - `FormField.Hint` will set `id` to `hint-${id}`
|
|
14
13
|
*
|
|
15
14
|
* If a value is not provided, a unique id will be automatically created by `useUniqueId()`.
|
|
16
|
-
* @default
|
|
15
|
+
* @default {useUniqueId}
|
|
17
16
|
*/
|
|
18
17
|
id: string;
|
|
19
18
|
/**
|
|
20
19
|
* Optional flag to denote if this field is required. When true the `FormField.Input` will have
|
|
21
20
|
* `required` set to true, and an asterisk will be appended to the `FormField.Label`.
|
|
22
|
-
* @default false
|
|
23
21
|
*/
|
|
24
22
|
isRequired: boolean;
|
|
25
23
|
}> & {} & {}) | undefined) => {
|
|
@@ -28,13 +26,11 @@ export declare const useFormFieldModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
28
26
|
/**
|
|
29
27
|
* Optional flag to denote if this field has an error to display. When true the `FormField.Input` will have
|
|
30
28
|
* `required` set to true, and usually some subcomponents will have a error color applied.
|
|
31
|
-
* @default false
|
|
32
29
|
*/
|
|
33
30
|
hasError: boolean;
|
|
34
31
|
/**
|
|
35
32
|
* Optional flag to denote if this field is required. When true the `FormField.Input` will have
|
|
36
33
|
* `required` set to true, and an asterisk will be appended to the `FormField.Label`.
|
|
37
|
-
* @default false
|
|
38
34
|
*/
|
|
39
35
|
isRequired: boolean;
|
|
40
36
|
};
|
|
@@ -43,7 +39,6 @@ export declare const useFormFieldModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
43
39
|
/**
|
|
44
40
|
* Optional flag to denote if this field has an error to display. When true the `FormField.Input` will have
|
|
45
41
|
* `required` set to true, and usually some subcomponents will have a error color applied.
|
|
46
|
-
* @default false
|
|
47
42
|
*/
|
|
48
43
|
hasError: boolean;
|
|
49
44
|
/**
|
|
@@ -54,13 +49,12 @@ export declare const useFormFieldModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
54
49
|
* - `FormField.Hint` will set `id` to `hint-${id}`
|
|
55
50
|
*
|
|
56
51
|
* If a value is not provided, a unique id will be automatically created by `useUniqueId()`.
|
|
57
|
-
* @default
|
|
52
|
+
* @default {useUniqueId}
|
|
58
53
|
*/
|
|
59
54
|
id: string;
|
|
60
55
|
/**
|
|
61
56
|
* Optional flag to denote if this field is required. When true the `FormField.Input` will have
|
|
62
57
|
* `required` set to true, and an asterisk will be appended to the `FormField.Label`.
|
|
63
|
-
* @default false
|
|
64
58
|
*/
|
|
65
59
|
isRequired: boolean;
|
|
66
60
|
}, {}, {
|
|
@@ -68,13 +62,11 @@ export declare const useFormFieldModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
68
62
|
/**
|
|
69
63
|
* Optional flag to denote if this field has an error to display. When true the `FormField.Input` will have
|
|
70
64
|
* `required` set to true, and usually some subcomponents will have a error color applied.
|
|
71
|
-
* @default false
|
|
72
65
|
*/
|
|
73
66
|
hasError: boolean;
|
|
74
67
|
/**
|
|
75
68
|
* Optional flag to denote if this field is required. When true the `FormField.Input` will have
|
|
76
69
|
* `required` set to true, and an asterisk will be appended to the `FormField.Label`.
|
|
77
|
-
* @default false
|
|
78
70
|
*/
|
|
79
71
|
isRequired: boolean;
|
|
80
72
|
}, {}, {
|
|
@@ -83,13 +75,11 @@ export declare const useFormFieldModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
83
75
|
/**
|
|
84
76
|
* Optional flag to denote if this field has an error to display. When true the `FormField.Input` will have
|
|
85
77
|
* `required` set to true, and usually some subcomponents will have a error color applied.
|
|
86
|
-
* @default false
|
|
87
78
|
*/
|
|
88
79
|
hasError: boolean;
|
|
89
80
|
/**
|
|
90
81
|
* Optional flag to denote if this field is required. When true the `FormField.Input` will have
|
|
91
82
|
* `required` set to true, and an asterisk will be appended to the `FormField.Label`.
|
|
92
|
-
* @default false
|
|
93
83
|
*/
|
|
94
84
|
isRequired: boolean;
|
|
95
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFormFieldModel.d.ts","sourceRoot":"","sources":["../../../../../form-field/lib/hooks/useFormFieldModel.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB;IAE1B
|
|
1
|
+
{"version":3,"file":"useFormFieldModel.d.ts","sourceRoot":"","sources":["../../../../../form-field/lib/hooks/useFormFieldModel.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB;IAE1B;;;OAGG;;IAEH;;;;;;;;;OASG;;IAEH;;;OAGG;;;;;QAnBH;;;WAGG;;QAaH;;;WAGG;;;;;IAnBH;;;OAGG;;IAEH;;;;;;;;;OASG;;IAEH;;;OAGG;;;;IAnBH;;;OAGG;;IAaH;;;OAGG;;;;;QAnBH;;;WAGG;;QAaH;;;WAGG;;;;EAeL,CAAC"}
|
|
@@ -15,7 +15,6 @@ export var useFormFieldModel = createModelHook({
|
|
|
15
15
|
/**
|
|
16
16
|
* Optional flag to denote if this field has an error to display. When true the `FormField.Input` will have
|
|
17
17
|
* `required` set to true, and usually some subcomponents will have a error color applied.
|
|
18
|
-
* @default false
|
|
19
18
|
*/
|
|
20
19
|
hasError: false,
|
|
21
20
|
/**
|
|
@@ -26,13 +25,12 @@ export var useFormFieldModel = createModelHook({
|
|
|
26
25
|
* - `FormField.Hint` will set `id` to `hint-${id}`
|
|
27
26
|
*
|
|
28
27
|
* If a value is not provided, a unique id will be automatically created by `useUniqueId()`.
|
|
29
|
-
* @default
|
|
28
|
+
* @default {useUniqueId}
|
|
30
29
|
*/
|
|
31
30
|
id: '',
|
|
32
31
|
/**
|
|
33
32
|
* Optional flag to denote if this field is required. When true the `FormField.Input` will have
|
|
34
33
|
* `required` set to true, and an asterisk will be appended to the `FormField.Label`.
|
|
35
|
-
* @default false
|
|
36
34
|
*/
|
|
37
35
|
isRequired: false,
|
|
38
36
|
},
|
|
@@ -56,12 +56,19 @@ export interface DeprecatedMenuState {
|
|
|
56
56
|
selectedItemIndex: number;
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
59
|
+
* As of Canvas Kit v8, this component is being soft-deprecated. It will be hard-deprecated
|
|
60
|
+
* (completely removed) in v9. Please see the [upgrade
|
|
61
|
+
* guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page) for
|
|
62
|
+
* more information.
|
|
60
63
|
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
64
|
+
* `DeprecatedMenu` renders a styled `<ul role="menu">` element within a {@link Card} and follows
|
|
65
|
+
* the [Active Menu
|
|
66
|
+
* pattern](https://www.w3.org/TR/wai-aria-practices/examples/menu-button/menu-button-actions-active-descendant.html)
|
|
67
|
+
* using `aria-activedescendant`.
|
|
68
|
+
*
|
|
69
|
+
* Undocumented props are spread to the underlying `<ul>` element.
|
|
70
|
+
*
|
|
71
|
+
* @deprecated
|
|
65
72
|
*/
|
|
66
73
|
export declare class DeprecatedMenu extends React.Component<DeprecatedMenuProps, DeprecatedMenuState> {
|
|
67
74
|
private id;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../menu/lib/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAA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);
|
|
7
7
|
};
|
|
8
8
|
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
9
11
|
extendStatics(d, b);
|
|
10
12
|
function __() { this.constructor = d; }
|
|
11
13
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -42,12 +44,19 @@ var List = styled('ul')(__assign({ background: commonColors.background, borderRa
|
|
|
42
44
|
outline: 'none',
|
|
43
45
|
} }, hideMouseFocus));
|
|
44
46
|
/**
|
|
45
|
-
*
|
|
47
|
+
* As of Canvas Kit v8, this component is being soft-deprecated. It will be hard-deprecated
|
|
48
|
+
* (completely removed) in v9. Please see the [upgrade
|
|
49
|
+
* guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page) for
|
|
50
|
+
* more information.
|
|
46
51
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
52
|
+
* `DeprecatedMenu` renders a styled `<ul role="menu">` element within a {@link Card} and follows
|
|
53
|
+
* the [Active Menu
|
|
54
|
+
* pattern](https://www.w3.org/TR/wai-aria-practices/examples/menu-button/menu-button-actions-active-descendant.html)
|
|
55
|
+
* using `aria-activedescendant`.
|
|
56
|
+
*
|
|
57
|
+
* Undocumented props are spread to the underlying `<ul>` element.
|
|
58
|
+
*
|
|
59
|
+
* @deprecated
|
|
51
60
|
*/
|
|
52
61
|
var DeprecatedMenu = /** @class */ (function (_super) {
|
|
53
62
|
__extends(DeprecatedMenu, _super);
|
|
@@ -57,12 +57,22 @@ export interface DeprecatedMenuItemProps extends React.LiHTMLAttributes<HTMLLIEl
|
|
|
57
57
|
shouldClose?: boolean;
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
60
|
+
* `DeprecatedMenuItem` renders an `<li>` element with the correct attributes to ensure it is
|
|
61
|
+
* accessible. If you choose to implement your own custom menu items, be sure to use semantic `<li>`
|
|
62
|
+
* elements with the following attributes:
|
|
61
63
|
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
64
|
+
* - `role="menuitem"`
|
|
65
|
+
* - `tabindex={-1}`
|
|
66
|
+
* - `id`s following this pattern: `${MenuId}-${index}`
|
|
67
|
+
*
|
|
68
|
+
* As of Canvas Kit v8, Menu is being soft-deprecated. It will be hard-deprecated (completely
|
|
69
|
+
* removed) in v9. Please see the [upgrade
|
|
70
|
+
* guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page) for
|
|
71
|
+
* more information.
|
|
72
|
+
*
|
|
73
|
+
* Undocumented props are spread to the underlying `<li>` element.
|
|
74
|
+
*
|
|
75
|
+
* @deprecated
|
|
66
76
|
*/
|
|
67
77
|
export declare class DeprecatedMenuItem extends React.Component<DeprecatedMenuItemProps> {
|
|
68
78
|
ref: React.RefObject<HTMLLIElement>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["../../../../menu/lib/MenuItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAG9D;;;;;;;GAOG;AACH,MAAM,WAAW,uBAAwB,SAAQ,KAAK,CAAC,gBAAgB,CAAC,aAAa,CAAC;IACpF;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC5C;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;OAEG;IACH,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,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CN,OAAO,CAAC,WAAW,CAOjB;CACH"}
|
|
@@ -6,6 +6,8 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
6
6
|
return extendStatics(d, b);
|
|
7
7
|
};
|
|
8
8
|
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
9
11
|
extendStatics(d, b);
|
|
10
12
|
function __() { this.constructor = d; }
|
|
11
13
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -118,7 +120,7 @@ var Divider = styled('hr')({
|
|
|
118
120
|
var iconSize = 24;
|
|
119
121
|
var iconPadding = 16;
|
|
120
122
|
var StyledSystemIcon = styled(SystemIcon)({
|
|
121
|
-
minWidth: iconSize + iconPadding,
|
|
123
|
+
minWidth: iconSize + iconPadding, // gives padding between LabelContainer, no matter the direction
|
|
122
124
|
});
|
|
123
125
|
var SecondaryStyledSystemIcon = styled(SystemIcon)({
|
|
124
126
|
display: "flex",
|
|
@@ -172,12 +174,22 @@ var scrollIntoViewIfNeeded = function (elem, centerIfNeeded) {
|
|
|
172
174
|
}
|
|
173
175
|
};
|
|
174
176
|
/**
|
|
175
|
-
*
|
|
177
|
+
* `DeprecatedMenuItem` renders an `<li>` element with the correct attributes to ensure it is
|
|
178
|
+
* accessible. If you choose to implement your own custom menu items, be sure to use semantic `<li>`
|
|
179
|
+
* elements with the following attributes:
|
|
180
|
+
*
|
|
181
|
+
* - `role="menuitem"`
|
|
182
|
+
* - `tabindex={-1}`
|
|
183
|
+
* - `id`s following this pattern: `${MenuId}-${index}`
|
|
184
|
+
*
|
|
185
|
+
* As of Canvas Kit v8, Menu is being soft-deprecated. It will be hard-deprecated (completely
|
|
186
|
+
* removed) in v9. Please see the [upgrade
|
|
187
|
+
* guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page) for
|
|
188
|
+
* more information.
|
|
189
|
+
*
|
|
190
|
+
* Undocumented props are spread to the underlying `<li>` element.
|
|
176
191
|
*
|
|
177
|
-
*
|
|
178
|
-
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
179
|
-
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
180
|
-
* for more information.
|
|
192
|
+
* @deprecated
|
|
181
193
|
*/
|
|
182
194
|
var DeprecatedMenuItem = /** @class */ (function (_super) {
|
|
183
195
|
__extends(DeprecatedMenuItem, _super);
|
|
@@ -6,6 +6,49 @@ export interface PillProps extends BoxProps {
|
|
|
6
6
|
*/
|
|
7
7
|
variant?: 'default' | 'readOnly' | 'removable';
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* By default, a `Pill` renders an interactive element that accepts subcomponents. By "interactive"
|
|
11
|
+
* we mean that the Pill container is a focusable element (a `<button>`). All leading elements
|
|
12
|
+
* (icons or avatars) are intended to be descriptive, helping support the label. They should not
|
|
13
|
+
* receive focus.
|
|
14
|
+
*
|
|
15
|
+
* `Pill` is the container component. It also provides a React context model for its subcomponents.
|
|
16
|
+
* Based on the `variant` prop this component will render different styled `Pill`s.
|
|
17
|
+
*
|
|
18
|
+
* Example of read only:
|
|
19
|
+
*
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <Pill variant="readOnly">This is a read only</Pill>
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* Example of interactive:
|
|
25
|
+
*
|
|
26
|
+
* ```tsx
|
|
27
|
+
* <Pill onClick={() => console.log('clicked')}>
|
|
28
|
+
* <Pill.Avatar /> Regina Skeltor
|
|
29
|
+
* </Pill>
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* Example of removable:
|
|
33
|
+
*
|
|
34
|
+
* ```tsx
|
|
35
|
+
* <Pill variant="removable">
|
|
36
|
+
* <Pill.Avatar /> Regina Skeltor
|
|
37
|
+
* <Pill.IconButton onClick={() => console.log('clicked')} />
|
|
38
|
+
* </Pill>
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* If you set the `Pill` `variant` to `removable`, it will render a `<span>` element. You can then
|
|
42
|
+
* provide a `Pill.IconButton` that acts as the focus target. This creates a smaller, more
|
|
43
|
+
* intentional click target that prevents users from accidentally deleting an item.
|
|
44
|
+
*
|
|
45
|
+
* ```tsx
|
|
46
|
+
* <Pill variant="removable">
|
|
47
|
+
* Shoes
|
|
48
|
+
* <Pill.IconButton onClick={() => console.log('handle remove')} />
|
|
49
|
+
* </Pill>
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
9
52
|
export declare const Pill: import("@workday/canvas-kit-react/common").ElementComponentM<"button", PillProps & Partial<{
|
|
10
53
|
maxWidth: string | number;
|
|
11
54
|
disabled: boolean;
|
|
@@ -18,7 +61,18 @@ export declare const Pill: import("@workday/canvas-kit-react/common").ElementCom
|
|
|
18
61
|
};
|
|
19
62
|
events: {};
|
|
20
63
|
}> & {
|
|
21
|
-
|
|
64
|
+
/**
|
|
65
|
+
* This component renders an avatar. It supports all props of the `Avatar` component.
|
|
66
|
+
*
|
|
67
|
+
* ```tsx
|
|
68
|
+
* <Pill variant="removable">
|
|
69
|
+
* <Pill.Avatar url={avatarUrl} />
|
|
70
|
+
* Regina Skeltor
|
|
71
|
+
* <Pill.IconButton onClick={() => console.log('handle remove')} />
|
|
72
|
+
* </Pill>
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
Avatar: import("@workday/canvas-kit-react/common").ElementComponentM<"button", import("./PillAvatar").PillAvatarProps, {
|
|
22
76
|
state: {
|
|
23
77
|
id: string;
|
|
24
78
|
maxWidth: string | number;
|
|
@@ -26,7 +80,30 @@ export declare const Pill: import("@workday/canvas-kit-react/common").ElementCom
|
|
|
26
80
|
};
|
|
27
81
|
events: {};
|
|
28
82
|
}>;
|
|
29
|
-
|
|
83
|
+
/**
|
|
84
|
+
* This component renders its `children` as the count.
|
|
85
|
+
*
|
|
86
|
+
* ```tsx
|
|
87
|
+
* <Pill onClick={() => console.warn('clicked')}>
|
|
88
|
+
* Shoes
|
|
89
|
+
* <Pill.Count>30</Pill.Count>
|
|
90
|
+
* </Pill>
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
Count: import("@workday/canvas-kit-react/common").ElementComponent<"span", import("./PillCount").PillCountProps>;
|
|
94
|
+
/**
|
|
95
|
+
* This component renders an `icon`. It not be used with the `default` styling – not `readOnly`
|
|
96
|
+
* or `removable` variants. By default it renders a `plusIcon` but it can be overridden by
|
|
97
|
+
* providing an icon to the `icon` prop.
|
|
98
|
+
*
|
|
99
|
+
* ```tsx
|
|
100
|
+
* <Pill onClick={() => console.warn('clicked')}>
|
|
101
|
+
* <Pill.Icon />
|
|
102
|
+
* <Pill.Label>Regina Skeltor</Pill.Label>
|
|
103
|
+
* </Pill>
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
Icon: import("@workday/canvas-kit-react/common").ElementComponentM<"span", import("./PillIcon").PillIconProps, {
|
|
30
107
|
state: {
|
|
31
108
|
id: string;
|
|
32
109
|
maxWidth: string | number;
|
|
@@ -34,8 +111,19 @@ export declare const Pill: import("@workday/canvas-kit-react/common").ElementCom
|
|
|
34
111
|
};
|
|
35
112
|
events: {};
|
|
36
113
|
}>;
|
|
37
|
-
|
|
38
|
-
|
|
114
|
+
/**
|
|
115
|
+
* This component renders a custom icon button. It is only intended to be used with the
|
|
116
|
+
* `removable` variant. By default, it renders a `xSmallIcon` but can be overridden by providing
|
|
117
|
+
* an icon to the `icon` prop.
|
|
118
|
+
*
|
|
119
|
+
* ```tsx
|
|
120
|
+
* <Pill variant="removable">
|
|
121
|
+
* Pink Shirts
|
|
122
|
+
* <Pill.IconButton onClick={() => console.warn('clicked')} />
|
|
123
|
+
* </Pill>
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
IconButton: import("@workday/canvas-kit-react/common").ElementComponentM<"button", import("./PillIconButton").PillIconButtonProps, {
|
|
39
127
|
state: {
|
|
40
128
|
id: string;
|
|
41
129
|
maxWidth: string | number;
|
|
@@ -43,7 +131,17 @@ export declare const Pill: import("@workday/canvas-kit-react/common").ElementCom
|
|
|
43
131
|
};
|
|
44
132
|
events: {};
|
|
45
133
|
}>;
|
|
46
|
-
|
|
134
|
+
/**
|
|
135
|
+
* This component renders a `<span>` that automatically handles overflow by rendering a tooltip.
|
|
136
|
+
* There's no need to use this component directly since the overflow is handled for you automatically.
|
|
137
|
+
*
|
|
138
|
+
* ```tsx
|
|
139
|
+
* <Pill variant="readOnly">
|
|
140
|
+
* <Pill.Label>Read-only</Pill.Label>
|
|
141
|
+
* </Pill>
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
Label: import("@workday/canvas-kit-react/common").ElementComponentM<"span", import("./PillLabel").PillLabelProps, {
|
|
47
145
|
state: {
|
|
48
146
|
id: string;
|
|
49
147
|
maxWidth: string | number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pill.d.ts","sourceRoot":"","sources":["../../../../pill/lib/Pill.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAC,QAAQ,EAAmB,MAAM,kCAAkC,CAAC;AAW5E,MAAM,WAAW,SAAU,SAAQ,QAAQ;IACzC;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,WAAW,CAAC;CAChD;AAsID,eAAO,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"Pill.d.ts","sourceRoot":"","sources":["../../../../pill/lib/Pill.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAC,QAAQ,EAAmB,MAAM,kCAAkC,CAAC;AAW5E,MAAM,WAAW,SAAU,SAAQ,QAAQ;IACzC;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,WAAW,CAAC;CAChD;AAsID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;IAIb;;;;;;;;;;OAUG;;;;;;;;;IAEH;;;;;;;;;OASG;;IAEH;;;;;;;;;;;OAWG;;;;;;;;;IAEH;;;;;;;;;;;OAWG;;;;;;;;;IAEH;;;;;;;;;OASG;;;;;;;;;CAyDL,CAAC"}
|
|
@@ -134,14 +134,113 @@ var StyledNonInteractivePill = styled(StyledBasePill)({
|
|
|
134
134
|
overflow: 'revert',
|
|
135
135
|
position: 'relative',
|
|
136
136
|
});
|
|
137
|
+
/**
|
|
138
|
+
* By default, a `Pill` renders an interactive element that accepts subcomponents. By "interactive"
|
|
139
|
+
* we mean that the Pill container is a focusable element (a `<button>`). All leading elements
|
|
140
|
+
* (icons or avatars) are intended to be descriptive, helping support the label. They should not
|
|
141
|
+
* receive focus.
|
|
142
|
+
*
|
|
143
|
+
* `Pill` is the container component. It also provides a React context model for its subcomponents.
|
|
144
|
+
* Based on the `variant` prop this component will render different styled `Pill`s.
|
|
145
|
+
*
|
|
146
|
+
* Example of read only:
|
|
147
|
+
*
|
|
148
|
+
* ```tsx
|
|
149
|
+
* <Pill variant="readOnly">This is a read only</Pill>
|
|
150
|
+
* ```
|
|
151
|
+
*
|
|
152
|
+
* Example of interactive:
|
|
153
|
+
*
|
|
154
|
+
* ```tsx
|
|
155
|
+
* <Pill onClick={() => console.log('clicked')}>
|
|
156
|
+
* <Pill.Avatar /> Regina Skeltor
|
|
157
|
+
* </Pill>
|
|
158
|
+
* ```
|
|
159
|
+
*
|
|
160
|
+
* Example of removable:
|
|
161
|
+
*
|
|
162
|
+
* ```tsx
|
|
163
|
+
* <Pill variant="removable">
|
|
164
|
+
* <Pill.Avatar /> Regina Skeltor
|
|
165
|
+
* <Pill.IconButton onClick={() => console.log('clicked')} />
|
|
166
|
+
* </Pill>
|
|
167
|
+
* ```
|
|
168
|
+
*
|
|
169
|
+
* If you set the `Pill` `variant` to `removable`, it will render a `<span>` element. You can then
|
|
170
|
+
* provide a `Pill.IconButton` that acts as the focus target. This creates a smaller, more
|
|
171
|
+
* intentional click target that prevents users from accidentally deleting an item.
|
|
172
|
+
*
|
|
173
|
+
* ```tsx
|
|
174
|
+
* <Pill variant="removable">
|
|
175
|
+
* Shoes
|
|
176
|
+
* <Pill.IconButton onClick={() => console.log('handle remove')} />
|
|
177
|
+
* </Pill>
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
137
180
|
export var Pill = createContainer('button')({
|
|
181
|
+
displayName: 'Pill',
|
|
138
182
|
modelHook: usePillModel,
|
|
139
183
|
subComponents: {
|
|
140
|
-
|
|
184
|
+
/**
|
|
185
|
+
* This component renders an avatar. It supports all props of the `Avatar` component.
|
|
186
|
+
*
|
|
187
|
+
* ```tsx
|
|
188
|
+
* <Pill variant="removable">
|
|
189
|
+
* <Pill.Avatar url={avatarUrl} />
|
|
190
|
+
* Regina Skeltor
|
|
191
|
+
* <Pill.IconButton onClick={() => console.log('handle remove')} />
|
|
192
|
+
* </Pill>
|
|
193
|
+
* ```
|
|
194
|
+
*/
|
|
141
195
|
Avatar: PillAvatar,
|
|
196
|
+
/**
|
|
197
|
+
* This component renders its `children` as the count.
|
|
198
|
+
*
|
|
199
|
+
* ```tsx
|
|
200
|
+
* <Pill onClick={() => console.warn('clicked')}>
|
|
201
|
+
* Shoes
|
|
202
|
+
* <Pill.Count>30</Pill.Count>
|
|
203
|
+
* </Pill>
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
142
206
|
Count: PillCount,
|
|
143
|
-
|
|
207
|
+
/**
|
|
208
|
+
* This component renders an `icon`. It not be used with the `default` styling – not `readOnly`
|
|
209
|
+
* or `removable` variants. By default it renders a `plusIcon` but it can be overridden by
|
|
210
|
+
* providing an icon to the `icon` prop.
|
|
211
|
+
*
|
|
212
|
+
* ```tsx
|
|
213
|
+
* <Pill onClick={() => console.warn('clicked')}>
|
|
214
|
+
* <Pill.Icon />
|
|
215
|
+
* <Pill.Label>Regina Skeltor</Pill.Label>
|
|
216
|
+
* </Pill>
|
|
217
|
+
* ```
|
|
218
|
+
*/
|
|
219
|
+
Icon: PillIcon,
|
|
220
|
+
/**
|
|
221
|
+
* This component renders a custom icon button. It is only intended to be used with the
|
|
222
|
+
* `removable` variant. By default, it renders a `xSmallIcon` but can be overridden by providing
|
|
223
|
+
* an icon to the `icon` prop.
|
|
224
|
+
*
|
|
225
|
+
* ```tsx
|
|
226
|
+
* <Pill variant="removable">
|
|
227
|
+
* Pink Shirts
|
|
228
|
+
* <Pill.IconButton onClick={() => console.warn('clicked')} />
|
|
229
|
+
* </Pill>
|
|
230
|
+
* ```
|
|
231
|
+
*/
|
|
144
232
|
IconButton: PillIconButton,
|
|
233
|
+
/**
|
|
234
|
+
* This component renders a `<span>` that automatically handles overflow by rendering a tooltip.
|
|
235
|
+
* There's no need to use this component directly since the overflow is handled for you automatically.
|
|
236
|
+
*
|
|
237
|
+
* ```tsx
|
|
238
|
+
* <Pill variant="readOnly">
|
|
239
|
+
* <Pill.Label>Read-only</Pill.Label>
|
|
240
|
+
* </Pill>
|
|
241
|
+
* ```
|
|
242
|
+
*/
|
|
243
|
+
Label: PillLabel,
|
|
145
244
|
},
|
|
146
245
|
})(function (_a, Element, model) {
|
|
147
246
|
var _b = _a.variant, variant = _b === void 0 ? 'default' : _b, maxWidth = _a.maxWidth, elemProps = __rest(_a, ["variant", "maxWidth"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../segmented-control/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,sCAAsC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../segmented-control/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,sCAAsC,CAAC;AACrD,cAAc,qCAAqC,CAAC;AACpD,OAAO,EAAC,uBAAuB,EAAC,MAAM,4BAA4B,CAAC"}
|