@workday/canvas-kit-react 15.0.0-alpha.0074-next.0 → 15.0.0-alpha.0075-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/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/pill/index.d.ts +8 -0
- package/dist/commonjs/pill/index.d.ts.map +1 -0
- package/dist/commonjs/pill/index.js +23 -0
- package/dist/commonjs/pill/lib/Pill.d.ts +265 -0
- package/dist/commonjs/pill/lib/Pill.d.ts.map +1 -0
- package/dist/commonjs/pill/lib/Pill.js +147 -0
- package/dist/commonjs/pill/lib/PillAvatar.d.ts +526 -0
- package/dist/commonjs/pill/lib/PillAvatar.d.ts.map +1 -0
- package/dist/commonjs/pill/lib/PillAvatar.js +22 -0
- package/dist/commonjs/pill/lib/PillCount.d.ts +12 -0
- package/dist/commonjs/pill/lib/PillCount.d.ts.map +1 -0
- package/dist/commonjs/pill/lib/PillCount.js +21 -0
- package/dist/commonjs/pill/lib/PillIcon.d.ts +54 -0
- package/dist/commonjs/pill/lib/PillIcon.d.ts.map +1 -0
- package/dist/commonjs/pill/lib/PillIcon.js +20 -0
- package/dist/commonjs/pill/lib/PillIconButton.d.ts +148 -0
- package/dist/commonjs/pill/lib/PillIconButton.d.ts.map +1 -0
- package/dist/commonjs/pill/lib/PillIconButton.js +21 -0
- package/dist/commonjs/pill/lib/PillLabel.d.ts +14 -0
- package/dist/commonjs/pill/lib/PillLabel.d.ts.map +1 -0
- package/dist/commonjs/pill/lib/PillLabel.js +17 -0
- package/dist/commonjs/pill/lib/usePillModel.d.ts +46 -0
- package/dist/commonjs/pill/lib/usePillModel.d.ts.map +1 -0
- package/dist/commonjs/pill/lib/usePillModel.js +24 -0
- package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts +1 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControl.js +1 -1
- 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/pill/index.d.ts +8 -0
- package/dist/es6/pill/index.d.ts.map +1 -0
- package/dist/es6/pill/index.js +7 -0
- package/dist/es6/pill/lib/Pill.d.ts +265 -0
- package/dist/es6/pill/lib/Pill.d.ts.map +1 -0
- package/dist/es6/pill/lib/Pill.js +144 -0
- package/dist/es6/pill/lib/PillAvatar.d.ts +526 -0
- package/dist/es6/pill/lib/PillAvatar.d.ts.map +1 -0
- package/dist/es6/pill/lib/PillAvatar.js +19 -0
- package/dist/es6/pill/lib/PillCount.d.ts +12 -0
- package/dist/es6/pill/lib/PillCount.d.ts.map +1 -0
- package/dist/es6/pill/lib/PillCount.js +18 -0
- package/dist/es6/pill/lib/PillIcon.d.ts +54 -0
- package/dist/es6/pill/lib/PillIcon.d.ts.map +1 -0
- package/dist/es6/pill/lib/PillIcon.js +17 -0
- package/dist/es6/pill/lib/PillIconButton.d.ts +148 -0
- package/dist/es6/pill/lib/PillIconButton.d.ts.map +1 -0
- package/dist/es6/pill/lib/PillIconButton.js +18 -0
- package/dist/es6/pill/lib/PillLabel.d.ts +14 -0
- package/dist/es6/pill/lib/PillLabel.d.ts.map +1 -0
- package/dist/es6/pill/lib/PillLabel.js +14 -0
- package/dist/es6/pill/lib/usePillModel.d.ts +46 -0
- package/dist/es6/pill/lib/usePillModel.d.ts.map +1 -0
- package/dist/es6/pill/lib/usePillModel.js +21 -0
- package/dist/es6/segmented-control/lib/SegmentedControl.d.ts +1 -1
- package/dist/es6/segmented-control/lib/SegmentedControl.js +1 -1
- package/index.ts +1 -0
- package/package.json +5 -5
- package/pill/index.ts +7 -0
- package/pill/lib/Pill.tsx +285 -0
- package/pill/lib/PillAvatar.tsx +35 -0
- package/pill/lib/PillCount.tsx +44 -0
- package/pill/lib/PillIcon.tsx +32 -0
- package/pill/lib/PillIconButton.tsx +86 -0
- package/pill/lib/PillLabel.tsx +32 -0
- package/pill/lib/usePillModel.tsx +23 -0
- package/pill/package.json +6 -0
- package/segmented-control/lib/SegmentedControl.tsx +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createSubcomponent } from '@workday/canvas-kit-react/common';
|
|
3
|
+
import { Avatar, avatarStencil } from '@workday/canvas-kit-preview-react/avatar';
|
|
4
|
+
import { usePillModel } from './usePillModel';
|
|
5
|
+
import { createStencil, px2rem } from '@workday/canvas-kit-styling';
|
|
6
|
+
import { mergeStyles } from '@workday/canvas-kit-react/layout';
|
|
7
|
+
import { system } from '@workday/canvas-tokens-web';
|
|
8
|
+
export const pillAvatarStencil = createStencil({
|
|
9
|
+
extends: avatarStencil,
|
|
10
|
+
base: { name: "1jjjid", styles: "box-sizing:border-box;flex:0 0 auto;font-family:var(--cnvs-sys-font-family-default);font-weight:var(--cnvs-sys-font-weight-normal);line-height:var(--cnvs-sys-line-height-subtext-small);font-size:var(--cnvs-sys-font-size-subtext-small);letter-spacing:var(--cnvs-base-letter-spacing-50);&:disabled, &.disabled{opacity:var(--cnvs-sys-opacity-disabled);}" }
|
|
11
|
+
}, "pill-avatar-f960e5");
|
|
12
|
+
export const PillAvatar = createSubcomponent('div')({
|
|
13
|
+
modelHook: usePillModel,
|
|
14
|
+
})(({ size, ...elemProps }, Element, _model) => {
|
|
15
|
+
return (_jsx(Avatar, { isDecorative: true, as: Element, size: px2rem(18), ...mergeStyles(elemProps, [
|
|
16
|
+
pillAvatarStencil(),
|
|
17
|
+
_model.state.disabled ? 'disabled' : undefined,
|
|
18
|
+
]) }));
|
|
19
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FlexProps } from '@workday/canvas-kit-react/layout';
|
|
2
|
+
export interface PillCountProps extends FlexProps {
|
|
3
|
+
}
|
|
4
|
+
export declare const pillCountStencil: import("@workday/canvas-kit-styling").Stencil<import("@workday/canvas-kit-styling").StencilModifierConfig<{}, {
|
|
5
|
+
backgroundColor: string;
|
|
6
|
+
borderColor: string;
|
|
7
|
+
}, never>, {}, {
|
|
8
|
+
backgroundColor: string;
|
|
9
|
+
borderColor: string;
|
|
10
|
+
}, never, never>;
|
|
11
|
+
export declare const PillCount: import("@workday/canvas-kit-react/common").ElementComponent<"span", PillCountProps>;
|
|
12
|
+
//# sourceMappingURL=PillCount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PillCount.d.ts","sourceRoot":"","sources":["../../../../pill/lib/PillCount.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAc,MAAM,kCAAkC,CAAC;AAIxE,MAAM,WAAW,cAAe,SAAQ,SAAS;CAAG;AAEpD,eAAO,MAAM,gBAAgB;;;;;;gBAyB3B,CAAC;AAEH,eAAO,MAAM,SAAS,qFASpB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
3
|
+
import { mergeStyles } from '@workday/canvas-kit-react/layout';
|
|
4
|
+
import { calc, createStencil, cssVar, px2rem } from '@workday/canvas-kit-styling';
|
|
5
|
+
import { system } from '@workday/canvas-tokens-web';
|
|
6
|
+
export const pillCountStencil = createStencil({
|
|
7
|
+
vars: {
|
|
8
|
+
backgroundColor: '',
|
|
9
|
+
borderColor: '',
|
|
10
|
+
},
|
|
11
|
+
base: { name: "35toxf", styles: "box-sizing:border-box;border-start-start-radius:var(--cnvs-sys-shape-zero);border-start-end-radius:var(--cnvs-sys-shape-x1);border-end-start-radius:var(--cnvs-sys-shape-zero);border-end-end-radius:var(--cnvs-sys-shape-x1);border-width:0.0625rem;border-inline-start-width:var(--cnvs-sys-space-zero);border-style:solid;border-color:var(--borderColor-pill-count-d52af1, var(--cnvs-sys-color-border-transparent));display:inline-flex;align-items:center;justify-content:center;height:1.375rem;width:var(--cnvs-sys-space-x6);padding:var(--cnvs-sys-space-zero) var(--cnvs-sys-space-x1);margin-inline-end:calc(var(--cnvs-sys-space-x2) * -1);margin-inline-start:var(--cnvs-sys-space-x1);background-color:var(--backgroundColor-pill-count-d52af1, var(--cnvs-sys-color-bg-alt-stronger));flex:0 0 auto;" }
|
|
12
|
+
}, "pill-count-d52af1");
|
|
13
|
+
export const PillCount = createComponent('span')({
|
|
14
|
+
displayName: 'Pill.Count',
|
|
15
|
+
Component: ({ children, ...elemProps }, ref, Element) => {
|
|
16
|
+
return (_jsx(Element, { ref: ref, ...mergeStyles(elemProps, pillCountStencil()), children: children }));
|
|
17
|
+
},
|
|
18
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { SystemIconProps } from '@workday/canvas-kit-react/icon';
|
|
2
|
+
export interface PillIconProps extends Partial<SystemIconProps> {
|
|
3
|
+
}
|
|
4
|
+
export declare const pillIconStencil: import("@workday/canvas-kit-styling").Stencil<import("@workday/canvas-kit-styling").StencilModifierConfig<{}, {}, import("@workday/canvas-kit-styling").Stencil<{}, {}, {
|
|
5
|
+
color: string;
|
|
6
|
+
accentColor: string;
|
|
7
|
+
backgroundColor: string;
|
|
8
|
+
}, import("@workday/canvas-kit-styling").Stencil<{
|
|
9
|
+
shouldMirror: {
|
|
10
|
+
true: {
|
|
11
|
+
transform: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
shouldMirrorInRTL: {
|
|
15
|
+
true: {
|
|
16
|
+
'&:dir(rtl)': {
|
|
17
|
+
transform: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
}, {}, {
|
|
22
|
+
width: string;
|
|
23
|
+
height: string;
|
|
24
|
+
size: string;
|
|
25
|
+
}, never, never>, never>>, {}, {}, import("@workday/canvas-kit-styling").Stencil<{}, {}, {
|
|
26
|
+
color: string;
|
|
27
|
+
accentColor: string;
|
|
28
|
+
backgroundColor: string;
|
|
29
|
+
}, import("@workday/canvas-kit-styling").Stencil<{
|
|
30
|
+
shouldMirror: {
|
|
31
|
+
true: {
|
|
32
|
+
transform: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
shouldMirrorInRTL: {
|
|
36
|
+
true: {
|
|
37
|
+
'&:dir(rtl)': {
|
|
38
|
+
transform: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
}, {}, {
|
|
43
|
+
width: string;
|
|
44
|
+
height: string;
|
|
45
|
+
size: string;
|
|
46
|
+
}, never, never>, never>, never>;
|
|
47
|
+
export declare const PillIcon: import("@workday/canvas-kit-react/common").ElementComponentM<"span", PillIconProps, {
|
|
48
|
+
state: {
|
|
49
|
+
id: string;
|
|
50
|
+
disabled: boolean;
|
|
51
|
+
};
|
|
52
|
+
events: {};
|
|
53
|
+
}>;
|
|
54
|
+
//# sourceMappingURL=PillIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PillIcon.d.ts","sourceRoot":"","sources":["../../../../pill/lib/PillIcon.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAa,eAAe,EAAoB,MAAM,gCAAgC,CAAC;AAO9F,MAAM,WAAW,aAAc,SAAQ,OAAO,CAAC,eAAe,CAAC;CAAG;AAElE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAO1B,CAAC;AAEH,eAAO,MAAM,QAAQ;;;;;;EAWnB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createSubcomponent } from '@workday/canvas-kit-react/common';
|
|
3
|
+
import { SystemIcon, systemIconStencil } from '@workday/canvas-kit-react/icon';
|
|
4
|
+
import { usePillModel } from './usePillModel';
|
|
5
|
+
import { plusIcon } from '@workday/canvas-system-icons-web';
|
|
6
|
+
import { calc, createStencil, px2rem } from '@workday/canvas-kit-styling';
|
|
7
|
+
import { system } from '@workday/canvas-tokens-web';
|
|
8
|
+
import { mergeStyles } from '@workday/canvas-kit-react/layout';
|
|
9
|
+
export const pillIconStencil = createStencil({
|
|
10
|
+
extends: systemIconStencil,
|
|
11
|
+
base: { name: "201cve", styles: "box-sizing:border-box;margin-inline-start:calc(var(--cnvs-sys-space-x1) * -1);--size-svg-8fcab8:1.25rem;flex:0 0 auto;" }
|
|
12
|
+
}, "pill-icon-9c34c5");
|
|
13
|
+
export const PillIcon = createSubcomponent('span')({
|
|
14
|
+
modelHook: usePillModel,
|
|
15
|
+
})(({ icon, ...elemProps }, Element) => {
|
|
16
|
+
return (_jsx(SystemIcon, { as: Element, role: "img", icon: icon || plusIcon, ...mergeStyles(elemProps, pillIconStencil()) }));
|
|
17
|
+
});
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { SystemIconProps } from '@workday/canvas-kit-react/icon';
|
|
2
|
+
export interface PillIconButtonProps extends Partial<SystemIconProps> {
|
|
3
|
+
/**
|
|
4
|
+
* The aria label for the removable icon. You must provide a valid string to represent the action.
|
|
5
|
+
*/
|
|
6
|
+
'aria-label'?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const pillIconButtonStencil: import("@workday/canvas-kit-styling").Stencil<import("@workday/canvas-kit-styling").StencilModifierConfig<{}, {}, import("@workday/canvas-kit-styling").Stencil<{
|
|
9
|
+
size: {
|
|
10
|
+
large: {
|
|
11
|
+
fontWeight: "--cnvs-sys-font-weight-bold";
|
|
12
|
+
height: "var(--cnvs-sys-size-xl, 3rem)";
|
|
13
|
+
paddingInline: "var(--cnvs-sys-padding-xxl, var(--cnvs-sys-space-x8))";
|
|
14
|
+
minWidth: "--cnvs-base-size-1400";
|
|
15
|
+
fontFamily: "--cnvs-sys-font-family-default";
|
|
16
|
+
lineHeight: "var(--cnvs-sys-line-height-body-sm, var(--cnvs-sys-line-height-body-small))";
|
|
17
|
+
fontSize: "var(--cnvs-sys-font-size-body-sm, var(--cnvs-sys-font-size-body-small))";
|
|
18
|
+
letterSpacing: "var(--cnvs-sys-letter-spacing-body-sm, var(--cnvs-base-letter-spacing-200))";
|
|
19
|
+
};
|
|
20
|
+
medium: {
|
|
21
|
+
fontWeight: "--cnvs-sys-font-weight-bold";
|
|
22
|
+
minWidth: "--cnvs-base-size-1200";
|
|
23
|
+
paddingInline: "var(--cnvs-sys-padding-xl, var(--cnvs-sys-space-x6))";
|
|
24
|
+
height: "var(--cnvs-sys-size-lg, var(--cnvs-sys-space-x10))";
|
|
25
|
+
fontFamily: "var(--cnvs-sys-font-family-default, var(--cnvs-sys-font-family-default))";
|
|
26
|
+
lineHeight: "var(--cnvs-sys-line-height-subtext-lg, var(--cnvs-sys-line-height-subtext-large))";
|
|
27
|
+
fontSize: "var(--cnvs-sys-font-size-subtext-lg, var(--cnvs-sys-font-size-subtext-large))";
|
|
28
|
+
letterSpacing: "var(--cnvs-sys-letter-spacing-subtext-lg, var(--cnvs-base-letter-spacing-50))";
|
|
29
|
+
};
|
|
30
|
+
small: {
|
|
31
|
+
fontWeight: "--cnvs-sys-font-weight-bold";
|
|
32
|
+
height: "var(--cnvs-sys-size-md, var(--cnvs-sys-space-x8))";
|
|
33
|
+
minWidth: "--cnvs-base-size-1000";
|
|
34
|
+
paddingInline: "var(--cnvs-sys-padding-md, var(--cnvs-sys-space-x4))";
|
|
35
|
+
gap: "var(--cnvs-sys-gap-xs, var(--cnvs-sys-space-x1))";
|
|
36
|
+
fontFamily: "var(--cnvs-sys-font-family-default, var(--cnvs-sys-font-family-default))";
|
|
37
|
+
lineHeight: "var(--cnvs-sys-line-height-subtext-lg, var(--cnvs-sys-line-height-subtext-large))";
|
|
38
|
+
fontSize: "var(--cnvs-sys-font-size-subtext-lg, var(--cnvs-sys-font-size-subtext-large))";
|
|
39
|
+
letterSpacing: "var(--cnvs-sys-letter-spacing-subtext-lg, var(--cnvs-base-letter-spacing-50))";
|
|
40
|
+
};
|
|
41
|
+
extraSmall: {
|
|
42
|
+
fontWeight: "--cnvs-sys-font-weight-bold";
|
|
43
|
+
height: "var(--cnvs-sys-size-sm, var(--cnvs-sys-space-x6))";
|
|
44
|
+
minWidth: string;
|
|
45
|
+
paddingInline: "var(--cnvs-sys-padding-sm, var(--cnvs-sys-space-x3))";
|
|
46
|
+
gap: "var(--cnvs-sys-gap-xs, var(--cnvs-sys-space-x1))";
|
|
47
|
+
fontFamily: "var(--cnvs-sys-font-family-default, var(--cnvs-sys-font-family-default))";
|
|
48
|
+
lineHeight: "var(--cnvs-sys-line-height-subtext-md, var(--cnvs-sys-line-height-subtext-medium))";
|
|
49
|
+
fontSize: "var(--cnvs-sys-font-size-subtext-md, var(--cnvs-sys-font-size-subtext-medium))";
|
|
50
|
+
letterSpacing: "var(--cnvs-sys-letter-spacing-subtext-md, var(--cnvs-base-letter-spacing-100))";
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
grow: {
|
|
54
|
+
true: {
|
|
55
|
+
width: string;
|
|
56
|
+
maxWidth: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
iconPosition: {
|
|
60
|
+
only: {
|
|
61
|
+
padding: "var(--cnvs-sys-padding-none, var(--cnvs-sys-space-zero))";
|
|
62
|
+
};
|
|
63
|
+
start: {};
|
|
64
|
+
end: {};
|
|
65
|
+
};
|
|
66
|
+
}, {}, {
|
|
67
|
+
background: string;
|
|
68
|
+
border: string;
|
|
69
|
+
boxShadowInner: string;
|
|
70
|
+
boxShadowOuter: string;
|
|
71
|
+
label: string;
|
|
72
|
+
opacity: string;
|
|
73
|
+
borderRadius: string;
|
|
74
|
+
}, never, never>>, {}, {}, import("@workday/canvas-kit-styling").Stencil<{
|
|
75
|
+
size: {
|
|
76
|
+
large: {
|
|
77
|
+
fontWeight: "--cnvs-sys-font-weight-bold";
|
|
78
|
+
height: "var(--cnvs-sys-size-xl, 3rem)";
|
|
79
|
+
paddingInline: "var(--cnvs-sys-padding-xxl, var(--cnvs-sys-space-x8))";
|
|
80
|
+
minWidth: "--cnvs-base-size-1400";
|
|
81
|
+
fontFamily: "--cnvs-sys-font-family-default";
|
|
82
|
+
lineHeight: "var(--cnvs-sys-line-height-body-sm, var(--cnvs-sys-line-height-body-small))";
|
|
83
|
+
fontSize: "var(--cnvs-sys-font-size-body-sm, var(--cnvs-sys-font-size-body-small))";
|
|
84
|
+
letterSpacing: "var(--cnvs-sys-letter-spacing-body-sm, var(--cnvs-base-letter-spacing-200))";
|
|
85
|
+
};
|
|
86
|
+
medium: {
|
|
87
|
+
fontWeight: "--cnvs-sys-font-weight-bold";
|
|
88
|
+
minWidth: "--cnvs-base-size-1200";
|
|
89
|
+
paddingInline: "var(--cnvs-sys-padding-xl, var(--cnvs-sys-space-x6))";
|
|
90
|
+
height: "var(--cnvs-sys-size-lg, var(--cnvs-sys-space-x10))";
|
|
91
|
+
fontFamily: "var(--cnvs-sys-font-family-default, var(--cnvs-sys-font-family-default))";
|
|
92
|
+
lineHeight: "var(--cnvs-sys-line-height-subtext-lg, var(--cnvs-sys-line-height-subtext-large))";
|
|
93
|
+
fontSize: "var(--cnvs-sys-font-size-subtext-lg, var(--cnvs-sys-font-size-subtext-large))";
|
|
94
|
+
letterSpacing: "var(--cnvs-sys-letter-spacing-subtext-lg, var(--cnvs-base-letter-spacing-50))";
|
|
95
|
+
};
|
|
96
|
+
small: {
|
|
97
|
+
fontWeight: "--cnvs-sys-font-weight-bold";
|
|
98
|
+
height: "var(--cnvs-sys-size-md, var(--cnvs-sys-space-x8))";
|
|
99
|
+
minWidth: "--cnvs-base-size-1000";
|
|
100
|
+
paddingInline: "var(--cnvs-sys-padding-md, var(--cnvs-sys-space-x4))";
|
|
101
|
+
gap: "var(--cnvs-sys-gap-xs, var(--cnvs-sys-space-x1))";
|
|
102
|
+
fontFamily: "var(--cnvs-sys-font-family-default, var(--cnvs-sys-font-family-default))";
|
|
103
|
+
lineHeight: "var(--cnvs-sys-line-height-subtext-lg, var(--cnvs-sys-line-height-subtext-large))";
|
|
104
|
+
fontSize: "var(--cnvs-sys-font-size-subtext-lg, var(--cnvs-sys-font-size-subtext-large))";
|
|
105
|
+
letterSpacing: "var(--cnvs-sys-letter-spacing-subtext-lg, var(--cnvs-base-letter-spacing-50))";
|
|
106
|
+
};
|
|
107
|
+
extraSmall: {
|
|
108
|
+
fontWeight: "--cnvs-sys-font-weight-bold";
|
|
109
|
+
height: "var(--cnvs-sys-size-sm, var(--cnvs-sys-space-x6))";
|
|
110
|
+
minWidth: string;
|
|
111
|
+
paddingInline: "var(--cnvs-sys-padding-sm, var(--cnvs-sys-space-x3))";
|
|
112
|
+
gap: "var(--cnvs-sys-gap-xs, var(--cnvs-sys-space-x1))";
|
|
113
|
+
fontFamily: "var(--cnvs-sys-font-family-default, var(--cnvs-sys-font-family-default))";
|
|
114
|
+
lineHeight: "var(--cnvs-sys-line-height-subtext-md, var(--cnvs-sys-line-height-subtext-medium))";
|
|
115
|
+
fontSize: "var(--cnvs-sys-font-size-subtext-md, var(--cnvs-sys-font-size-subtext-medium))";
|
|
116
|
+
letterSpacing: "var(--cnvs-sys-letter-spacing-subtext-md, var(--cnvs-base-letter-spacing-100))";
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
grow: {
|
|
120
|
+
true: {
|
|
121
|
+
width: string;
|
|
122
|
+
maxWidth: string;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
iconPosition: {
|
|
126
|
+
only: {
|
|
127
|
+
padding: "var(--cnvs-sys-padding-none, var(--cnvs-sys-space-zero))";
|
|
128
|
+
};
|
|
129
|
+
start: {};
|
|
130
|
+
end: {};
|
|
131
|
+
};
|
|
132
|
+
}, {}, {
|
|
133
|
+
background: string;
|
|
134
|
+
border: string;
|
|
135
|
+
boxShadowInner: string;
|
|
136
|
+
boxShadowOuter: string;
|
|
137
|
+
label: string;
|
|
138
|
+
opacity: string;
|
|
139
|
+
borderRadius: string;
|
|
140
|
+
}, never, never>, never>;
|
|
141
|
+
export declare const PillIconButton: import("@workday/canvas-kit-react/common").ElementComponentM<"button", PillIconButtonProps, {
|
|
142
|
+
state: {
|
|
143
|
+
id: string;
|
|
144
|
+
disabled: boolean;
|
|
145
|
+
};
|
|
146
|
+
events: {};
|
|
147
|
+
}>;
|
|
148
|
+
//# sourceMappingURL=PillIconButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PillIconButton.d.ts","sourceRoot":"","sources":["../../../../pill/lib/PillIconButton.tsx"],"names":[],"mappings":"AACA,OAAO,EAAa,eAAe,EAAoB,MAAM,gCAAgC,CAAC;AAQ9F,MAAM,WAAW,mBAAoB,SAAQ,OAAO,CAAC,eAAe,CAAC;IACnE;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA+ChC,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;EAoB1B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { focusRing, createSubcomponent } from '@workday/canvas-kit-react/common';
|
|
3
|
+
import { SystemIcon, systemIconStencil } from '@workday/canvas-kit-react/icon';
|
|
4
|
+
import { usePillModel } from './usePillModel';
|
|
5
|
+
import { xSmallIcon } from '@workday/canvas-system-icons-web';
|
|
6
|
+
import { buttonStencil } from '@workday/canvas-kit-react/button';
|
|
7
|
+
import { calc, createStencil, px2rem } from '@workday/canvas-kit-styling';
|
|
8
|
+
import { system } from '@workday/canvas-tokens-web';
|
|
9
|
+
import { mergeStyles } from '@workday/canvas-kit-react/layout';
|
|
10
|
+
export const pillIconButtonStencil = createStencil({
|
|
11
|
+
extends: buttonStencil,
|
|
12
|
+
base: { name: "1cihdw", styles: "box-sizing:border-box;margin-inline-end:calc(0.4375rem * -1);margin-inline-start:calc(0.125rem * -1);border-radius:var(--cnvs-sys-shape-half);height:calc(var(--cnvs-sys-space-x4) + var(--cnvs-sys-space-x1));width:calc(var(--cnvs-sys-space-x4) + var(--cnvs-sys-space-x1));padding:var(--cnvs-sys-space-zero);overflow:visible;flex:0 0 auto;--border-button-f6d2bd:var(--cnvs-sys-color-border-transparent);--background-button-f6d2bd:var(--cnvs-sys-color-bg-alt-default);--color-system-icon-3a4847:var(--cnvs-sys-color-fg-strong);--size-svg-8fcab8:var(--cnvs-sys-space-x6);::after{content:\"\";height:var(--cnvs-sys-space-x8);width:var(--cnvs-sys-space-x8);position:absolute;left:calc(0.4375rem * -1);bottom:calc(0.4375rem * -1);margin:var(--cnvs-sys-space-zero);pointer-events:all;}&:focus-visible, &.focus{--border-button-f6d2bd:var(--cnvs-sys-color-border-transparent);--background-button-f6d2bd:var(--cnvs-sys-color-bg-alt-default);box-shadow:0 0 0 0px var(--cnvs-sys-color-border-transparent), 0 0 0 2px var(--cnvs-brand-common-focus-outline, rgba(8,117,225,1));}&:hover, &.hover{--border-button-f6d2bd:var(--cnvs-sys-color-border-transparent);--background-button-f6d2bd:var(--cnvs-sys-color-bg-alt-strong);}&:active, &.active{--border-button-f6d2bd:var(--cnvs-sys-color-border-transparent);--background-button-f6d2bd:var(--cnvs-sys-color-bg-alt-stronger);}&:disabled, &.disabled{--border-button-f6d2bd:var(--cnvs-sys-color-border-transparent);--background-button-f6d2bd:var(--cnvs-sys-color-bg-alt-default);--color-system-icon-3a4847:var(--cnvs-sys-color-fg-disabled);}" }
|
|
13
|
+
}, "pill-icon-button-c3ae9d");
|
|
14
|
+
export const PillIconButton = createSubcomponent('button')({
|
|
15
|
+
modelHook: usePillModel,
|
|
16
|
+
})(({ size, icon, children, 'aria-label': ariaLabel = '', ...elemProps }, Element, model) => {
|
|
17
|
+
return (_jsx(Element, { disabled: model.state.disabled, "aria-labelledby": `removable-${model.state.id} label-${model.state.id}`, ...mergeStyles(elemProps, pillIconButtonStencil()), children: _jsx(SystemIcon, { "aria-label": ariaLabel, id: `removable-${model.state.id}`, icon: icon || xSmallIcon, "aria-hidden": true, role: "img" }) }));
|
|
18
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BoxProps } from '@workday/canvas-kit-react/layout';
|
|
2
|
+
import { OverflowTooltipProps } from '@workday/canvas-kit-react/tooltip';
|
|
3
|
+
export interface PillLabelProps extends BoxProps {
|
|
4
|
+
tooltipProps?: Omit<OverflowTooltipProps, 'children'>;
|
|
5
|
+
}
|
|
6
|
+
export declare const pillLabelStencil: import("@workday/canvas-kit-styling").Stencil<import("@workday/canvas-kit-styling").StencilModifierConfig<{}, {}, never>, {}, {}, never, never>;
|
|
7
|
+
export declare const PillLabel: import("@workday/canvas-kit-react/common").ElementComponentM<"span", PillLabelProps, {
|
|
8
|
+
state: {
|
|
9
|
+
id: string;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
};
|
|
12
|
+
events: {};
|
|
13
|
+
}>;
|
|
14
|
+
//# sourceMappingURL=PillLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PillLabel.d.ts","sourceRoot":"","sources":["../../../../pill/lib/PillLabel.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAc,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAkB,oBAAoB,EAAC,MAAM,mCAAmC,CAAC;AAMxF,MAAM,WAAW,cAAe,SAAQ,QAAQ;IAC9C,YAAY,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC;CACvD;AAED,eAAO,MAAM,gBAAgB,iJAO3B,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;;EAUpB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createSubcomponent } from '@workday/canvas-kit-react/common';
|
|
3
|
+
import { mergeStyles } from '@workday/canvas-kit-react/layout';
|
|
4
|
+
import { OverflowTooltip } from '@workday/canvas-kit-react/tooltip';
|
|
5
|
+
import { usePillModel } from './usePillModel';
|
|
6
|
+
import { createStencil } from '@workday/canvas-kit-styling';
|
|
7
|
+
export const pillLabelStencil = createStencil({
|
|
8
|
+
base: { name: "3j86df", styles: "box-sizing:border-box;flex-shrink:1;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;" }
|
|
9
|
+
}, "pill-label-2b9705");
|
|
10
|
+
export const PillLabel = createSubcomponent('span')({
|
|
11
|
+
modelHook: usePillModel,
|
|
12
|
+
})(({ tooltipProps, children, ...elemProps }, Element, model) => {
|
|
13
|
+
return (_jsx(OverflowTooltip, { ...tooltipProps, children: _jsx(Element, { id: `label-${model.state.id}`, ...mergeStyles(elemProps, pillLabelStencil()), children: children }) }));
|
|
14
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export declare const usePillModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
2
|
+
/**
|
|
3
|
+
* Used to disable a pill and apply the correct styles.
|
|
4
|
+
*/
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* ID used to add accessibility labels to pill elements.
|
|
8
|
+
* @default `useUniqueId()`
|
|
9
|
+
*/
|
|
10
|
+
id: string;
|
|
11
|
+
}> & {} & {}) | undefined) => {
|
|
12
|
+
state: {
|
|
13
|
+
id: string;
|
|
14
|
+
/**
|
|
15
|
+
* Used to disable a pill and apply the correct styles.
|
|
16
|
+
*/
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
};
|
|
19
|
+
events: {};
|
|
20
|
+
}) & import("@workday/canvas-kit-react/common").ModelExtras<{
|
|
21
|
+
/**
|
|
22
|
+
* Used to disable a pill and apply the correct styles.
|
|
23
|
+
*/
|
|
24
|
+
disabled: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* ID used to add accessibility labels to pill elements.
|
|
27
|
+
* @default `useUniqueId()`
|
|
28
|
+
*/
|
|
29
|
+
id: string;
|
|
30
|
+
}, {}, {
|
|
31
|
+
id: string;
|
|
32
|
+
/**
|
|
33
|
+
* Used to disable a pill and apply the correct styles.
|
|
34
|
+
*/
|
|
35
|
+
disabled: boolean;
|
|
36
|
+
}, {}, {
|
|
37
|
+
state: {
|
|
38
|
+
id: string;
|
|
39
|
+
/**
|
|
40
|
+
* Used to disable a pill and apply the correct styles.
|
|
41
|
+
*/
|
|
42
|
+
disabled: boolean;
|
|
43
|
+
};
|
|
44
|
+
events: {};
|
|
45
|
+
}>;
|
|
46
|
+
//# sourceMappingURL=usePillModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePillModel.d.ts","sourceRoot":"","sources":["../../../../pill/lib/usePillModel.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;IAErB;;OAEG;;IAEH;;;OAGG;;;;;QAPH;;WAEG;;;;;IAFH;;OAEG;;IAEH;;;OAGG;;;;IAPH;;OAEG;;;;;QAFH;;WAEG;;;;EAgBL,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createModelHook, useUniqueId } from '@workday/canvas-kit-react/common';
|
|
2
|
+
export const usePillModel = createModelHook({
|
|
3
|
+
defaultConfig: {
|
|
4
|
+
/**
|
|
5
|
+
* Used to disable a pill and apply the correct styles.
|
|
6
|
+
*/
|
|
7
|
+
disabled: false,
|
|
8
|
+
/**
|
|
9
|
+
* ID used to add accessibility labels to pill elements.
|
|
10
|
+
* @default `useUniqueId()`
|
|
11
|
+
*/
|
|
12
|
+
id: '',
|
|
13
|
+
},
|
|
14
|
+
})(config => {
|
|
15
|
+
const id = useUniqueId(config.id);
|
|
16
|
+
const state = {
|
|
17
|
+
...config,
|
|
18
|
+
id,
|
|
19
|
+
};
|
|
20
|
+
return { state, events: {} };
|
|
21
|
+
});
|
|
@@ -19,7 +19,7 @@ export interface SegmentedControlProps {
|
|
|
19
19
|
* items: [],
|
|
20
20
|
* });
|
|
21
21
|
*
|
|
22
|
-
* <SegmentedControl model={model}>{Child components}</SegmentedControl
|
|
22
|
+
* <SegmentedControl model={model}>{Child components}</SegmentedControl>
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
25
|
export declare const SegmentedControl: import("@workday/canvas-kit-react/common").ComponentM<SegmentedControlProps & Partial<{
|
|
@@ -20,7 +20,7 @@ import { SegmentedControlItem } from './SegmentedControlItem';
|
|
|
20
20
|
* items: [],
|
|
21
21
|
* });
|
|
22
22
|
*
|
|
23
|
-
* <SegmentedControl model={model}>{Child components}</SegmentedControl
|
|
23
|
+
* <SegmentedControl model={model}>{Child components}</SegmentedControl>
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
26
|
export const SegmentedControl = createContainer()({
|
package/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-react",
|
|
3
|
-
"version": "15.0.0-alpha.
|
|
3
|
+
"version": "15.0.0-alpha.0075-next.0",
|
|
4
4
|
"description": "The parent module that contains all Workday Canvas Kit React components",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
"@popperjs/core": "^2.5.4",
|
|
53
53
|
"@tanstack/react-virtual": "^3.13.9",
|
|
54
54
|
"@workday/canvas-colors-web": "^2.0.0",
|
|
55
|
-
"@workday/canvas-kit-popup-stack": "^15.0.0-alpha.
|
|
56
|
-
"@workday/canvas-kit-preview-react": "^15.0.0-alpha.
|
|
57
|
-
"@workday/canvas-kit-styling": "^15.0.0-alpha.
|
|
55
|
+
"@workday/canvas-kit-popup-stack": "^15.0.0-alpha.0075-next.0",
|
|
56
|
+
"@workday/canvas-kit-preview-react": "^15.0.0-alpha.0075-next.0",
|
|
57
|
+
"@workday/canvas-kit-styling": "^15.0.0-alpha.0075-next.0",
|
|
58
58
|
"@workday/canvas-system-icons-web": "^3.0.36",
|
|
59
59
|
"@workday/canvas-tokens-web": "4.0.0-alpha.3",
|
|
60
60
|
"@workday/design-assets-types": "^0.2.10",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"@workday/canvas-accent-icons-web": "^3.0.0",
|
|
70
70
|
"@workday/canvas-applet-icons-web": "^2.0.0"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "85c5dfa329d29263f96a49be74ef55f551990c7b"
|
|
73
73
|
}
|