@corefoundry-labs/forge-ui 1.0.2 → 1.1.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/LICENSE +202 -0
- package/README.md +78 -0
- package/dist/components/layout/ThemeScope/ThemeScope.d.ts +11 -0
- package/dist/components/layout/ThemeScope/ThemeScope.d.ts.map +1 -0
- package/dist/components/layout/ThemeScope/ThemeScope.js +13 -0
- package/dist/components/layout/ThemeScope/index.d.ts +3 -0
- package/dist/components/layout/ThemeScope/index.d.ts.map +1 -0
- package/dist/components/layout/ThemeScope/index.js +1 -0
- package/dist/componentsV2/actions/ButtonV2/ButtonV2.d.ts +21 -0
- package/dist/componentsV2/actions/ButtonV2/ButtonV2.d.ts.map +1 -0
- package/dist/componentsV2/actions/ButtonV2/ButtonV2.js +17 -0
- package/dist/componentsV2/actions/ButtonV2/ButtonV2.module.css +158 -0
- package/dist/componentsV2/actions/ButtonV2/index.d.ts +3 -0
- package/dist/componentsV2/actions/ButtonV2/index.d.ts.map +1 -0
- package/dist/componentsV2/actions/ButtonV2/index.js +1 -0
- package/dist/componentsV2/data-display/AvatarV2/AvatarV2.d.ts +36 -0
- package/dist/componentsV2/data-display/AvatarV2/AvatarV2.d.ts.map +1 -0
- package/dist/componentsV2/data-display/AvatarV2/AvatarV2.js +23 -0
- package/dist/componentsV2/data-display/AvatarV2/AvatarV2.module.css +156 -0
- package/dist/componentsV2/data-display/AvatarV2/index.d.ts +3 -0
- package/dist/componentsV2/data-display/AvatarV2/index.d.ts.map +1 -0
- package/dist/componentsV2/data-display/AvatarV2/index.js +1 -0
- package/dist/componentsV2/feedback/AlertV2/AlertV2.d.ts +25 -0
- package/dist/componentsV2/feedback/AlertV2/AlertV2.d.ts.map +1 -0
- package/dist/componentsV2/feedback/AlertV2/AlertV2.js +16 -0
- package/dist/componentsV2/feedback/AlertV2/AlertV2.module.css +144 -0
- package/dist/componentsV2/feedback/AlertV2/index.d.ts +3 -0
- package/dist/componentsV2/feedback/AlertV2/index.d.ts.map +1 -0
- package/dist/componentsV2/feedback/AlertV2/index.js +1 -0
- package/dist/componentsV2/feedback/FeedbackStateV2/FeedbackStateV2.d.ts +13 -0
- package/dist/componentsV2/feedback/FeedbackStateV2/FeedbackStateV2.d.ts.map +1 -0
- package/dist/componentsV2/feedback/FeedbackStateV2/FeedbackStateV2.js +18 -0
- package/dist/componentsV2/feedback/FeedbackStateV2/FeedbackStateV2.module.css +102 -0
- package/dist/componentsV2/feedback/FeedbackStateV2/index.d.ts +3 -0
- package/dist/componentsV2/feedback/FeedbackStateV2/index.d.ts.map +1 -0
- package/dist/componentsV2/feedback/FeedbackStateV2/index.js +1 -0
- package/dist/componentsV2/feedback/ProgressV2/ProgressV2.d.ts +35 -0
- package/dist/componentsV2/feedback/ProgressV2/ProgressV2.d.ts.map +1 -0
- package/dist/componentsV2/feedback/ProgressV2/ProgressV2.js +15 -0
- package/dist/componentsV2/feedback/ProgressV2/ProgressV2.module.css +161 -0
- package/dist/componentsV2/feedback/ProgressV2/index.d.ts +3 -0
- package/dist/componentsV2/feedback/ProgressV2/index.d.ts.map +1 -0
- package/dist/componentsV2/feedback/ProgressV2/index.js +1 -0
- package/dist/componentsV2/feedback/SkeletonV2/SkeletonV2.d.ts +20 -0
- package/dist/componentsV2/feedback/SkeletonV2/SkeletonV2.d.ts.map +1 -0
- package/dist/componentsV2/feedback/SkeletonV2/SkeletonV2.js +8 -0
- package/dist/componentsV2/feedback/SkeletonV2/SkeletonV2.module.css +92 -0
- package/dist/componentsV2/feedback/SkeletonV2/index.d.ts +3 -0
- package/dist/componentsV2/feedback/SkeletonV2/index.d.ts.map +1 -0
- package/dist/componentsV2/feedback/SkeletonV2/index.js +1 -0
- package/dist/componentsV2/feedback/SnackbarV2/SnackbarV2.d.ts +35 -0
- package/dist/componentsV2/feedback/SnackbarV2/SnackbarV2.d.ts.map +1 -0
- package/dist/componentsV2/feedback/SnackbarV2/SnackbarV2.js +90 -0
- package/dist/componentsV2/feedback/SnackbarV2/SnackbarV2.module.css +162 -0
- package/dist/componentsV2/feedback/SnackbarV2/index.d.ts +3 -0
- package/dist/componentsV2/feedback/SnackbarV2/index.d.ts.map +1 -0
- package/dist/componentsV2/feedback/SnackbarV2/index.js +1 -0
- package/dist/componentsV2/forms/CheckboxV2/CheckboxV2.d.ts +10 -0
- package/dist/componentsV2/forms/CheckboxV2/CheckboxV2.d.ts.map +1 -0
- package/dist/componentsV2/forms/CheckboxV2/CheckboxV2.js +18 -0
- package/dist/componentsV2/forms/CheckboxV2/CheckboxV2.module.css +137 -0
- package/dist/componentsV2/forms/CheckboxV2/index.d.ts +3 -0
- package/dist/componentsV2/forms/CheckboxV2/index.d.ts.map +1 -0
- package/dist/componentsV2/forms/CheckboxV2/index.js +1 -0
- package/dist/componentsV2/forms/SelectV2/SelectV2.d.ts +10 -0
- package/dist/componentsV2/forms/SelectV2/SelectV2.d.ts.map +1 -0
- package/dist/componentsV2/forms/SelectV2/SelectV2.js +7 -0
- package/dist/componentsV2/forms/SelectV2/SelectV2.module.css +90 -0
- package/dist/componentsV2/forms/SelectV2/index.d.ts +3 -0
- package/dist/componentsV2/forms/SelectV2/index.d.ts.map +1 -0
- package/dist/componentsV2/forms/SelectV2/index.js +1 -0
- package/dist/componentsV2/forms/SwitchV2/SwitchV2.d.ts +8 -0
- package/dist/componentsV2/forms/SwitchV2/SwitchV2.d.ts.map +1 -0
- package/dist/componentsV2/forms/SwitchV2/SwitchV2.js +8 -0
- package/dist/componentsV2/forms/SwitchV2/SwitchV2.module.css +129 -0
- package/dist/componentsV2/forms/SwitchV2/index.d.ts +3 -0
- package/dist/componentsV2/forms/SwitchV2/index.d.ts.map +1 -0
- package/dist/componentsV2/forms/SwitchV2/index.js +1 -0
- package/dist/componentsV2/forms/TextInputV2/TextInputV2.d.ts +10 -0
- package/dist/componentsV2/forms/TextInputV2/TextInputV2.d.ts.map +1 -0
- package/dist/componentsV2/forms/TextInputV2/TextInputV2.js +7 -0
- package/dist/componentsV2/forms/TextInputV2/TextInputV2.module.css +64 -0
- package/dist/componentsV2/forms/TextInputV2/index.d.ts +3 -0
- package/dist/componentsV2/forms/TextInputV2/index.d.ts.map +1 -0
- package/dist/componentsV2/forms/TextInputV2/index.js +1 -0
- package/dist/componentsV2/forms/selectionControl.d.ts +14 -0
- package/dist/componentsV2/forms/selectionControl.d.ts.map +1 -0
- package/dist/componentsV2/forms/selectionControl.js +1 -0
- package/dist/componentsV2/navigation/TabsV2/TabsV2.d.ts +30 -0
- package/dist/componentsV2/navigation/TabsV2/TabsV2.d.ts.map +1 -0
- package/dist/componentsV2/navigation/TabsV2/TabsV2.js +54 -0
- package/dist/componentsV2/navigation/TabsV2/TabsV2.module.css +128 -0
- package/dist/componentsV2/navigation/TabsV2/index.d.ts +3 -0
- package/dist/componentsV2/navigation/TabsV2/index.d.ts.map +1 -0
- package/dist/componentsV2/navigation/TabsV2/index.js +1 -0
- package/dist/componentsV2/overlays/DialogV2/DialogV2.d.ts +22 -0
- package/dist/componentsV2/overlays/DialogV2/DialogV2.d.ts.map +1 -0
- package/dist/componentsV2/overlays/DialogV2/DialogV2.js +77 -0
- package/dist/componentsV2/overlays/DialogV2/DialogV2.module.css +91 -0
- package/dist/componentsV2/overlays/DialogV2/index.d.ts +3 -0
- package/dist/componentsV2/overlays/DialogV2/index.d.ts.map +1 -0
- package/dist/componentsV2/overlays/DialogV2/index.js +1 -0
- package/dist/componentsV2/overlays/DropdownMenuV2/DropdownMenuV2.d.ts +40 -0
- package/dist/componentsV2/overlays/DropdownMenuV2/DropdownMenuV2.d.ts.map +1 -0
- package/dist/componentsV2/overlays/DropdownMenuV2/DropdownMenuV2.js +115 -0
- package/dist/componentsV2/overlays/DropdownMenuV2/DropdownMenuV2.module.css +122 -0
- package/dist/componentsV2/overlays/DropdownMenuV2/index.d.ts +3 -0
- package/dist/componentsV2/overlays/DropdownMenuV2/index.d.ts.map +1 -0
- package/dist/componentsV2/overlays/DropdownMenuV2/index.js +1 -0
- package/dist/componentsV2/overlays/PopoverV2/PopoverV2.d.ts +46 -0
- package/dist/componentsV2/overlays/PopoverV2/PopoverV2.d.ts.map +1 -0
- package/dist/componentsV2/overlays/PopoverV2/PopoverV2.js +41 -0
- package/dist/componentsV2/overlays/PopoverV2/PopoverV2.module.css +63 -0
- package/dist/componentsV2/overlays/PopoverV2/index.d.ts +3 -0
- package/dist/componentsV2/overlays/PopoverV2/index.d.ts.map +1 -0
- package/dist/componentsV2/overlays/PopoverV2/index.js +1 -0
- package/dist/componentsV2/overlays/TooltipV2/TooltipV2.d.ts +18 -0
- package/dist/componentsV2/overlays/TooltipV2/TooltipV2.d.ts.map +1 -0
- package/dist/componentsV2/overlays/TooltipV2/TooltipV2.js +66 -0
- package/dist/componentsV2/overlays/TooltipV2/TooltipV2.module.css +69 -0
- package/dist/componentsV2/overlays/TooltipV2/index.d.ts +3 -0
- package/dist/componentsV2/overlays/TooltipV2/index.d.ts.map +1 -0
- package/dist/componentsV2/overlays/TooltipV2/index.js +1 -0
- package/dist/componentsV2/overlays/layer.d.ts +29 -0
- package/dist/componentsV2/overlays/layer.d.ts.map +1 -0
- package/dist/componentsV2/overlays/layer.js +224 -0
- package/dist/componentsV2/overlays/position.d.ts +32 -0
- package/dist/componentsV2/overlays/position.d.ts.map +1 -0
- package/dist/componentsV2/overlays/position.js +42 -0
- package/dist/componentsV2/status/BadgeV2/BadgeV2.d.ts +18 -0
- package/dist/componentsV2/status/BadgeV2/BadgeV2.d.ts.map +1 -0
- package/dist/componentsV2/status/BadgeV2/BadgeV2.js +7 -0
- package/dist/componentsV2/status/BadgeV2/BadgeV2.module.css +94 -0
- package/dist/componentsV2/status/BadgeV2/index.d.ts +3 -0
- package/dist/componentsV2/status/BadgeV2/index.d.ts.map +1 -0
- package/dist/componentsV2/status/BadgeV2/index.js +1 -0
- package/dist/componentsV2/surfaces/CardV2/CardV2.d.ts +28 -0
- package/dist/componentsV2/surfaces/CardV2/CardV2.d.ts.map +1 -0
- package/dist/componentsV2/surfaces/CardV2/CardV2.js +16 -0
- package/dist/componentsV2/surfaces/CardV2/CardV2.module.css +84 -0
- package/dist/componentsV2/surfaces/CardV2/index.d.ts +3 -0
- package/dist/componentsV2/surfaces/CardV2/index.d.ts.map +1 -0
- package/dist/componentsV2/surfaces/CardV2/index.js +1 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -0
- package/package.json +16 -5
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
.progress {
|
|
2
|
+
color: var(--cf-v2-on-surface);
|
|
3
|
+
font-family: inherit;
|
|
4
|
+
line-height: normal;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.normal {
|
|
8
|
+
--progress-fill: var(--cf-v2-action-primary);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.success {
|
|
12
|
+
--progress-fill: var(--cf-v2-success);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.error {
|
|
16
|
+
--progress-fill: var(--cf-v2-error);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.linear {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
gap: var(--cf-v2-progress-gap);
|
|
23
|
+
width: 100%;
|
|
24
|
+
min-width: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.header {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: baseline;
|
|
30
|
+
justify-content: space-between;
|
|
31
|
+
gap: var(--cf-v2-progress-header-gap);
|
|
32
|
+
font-weight: var(--cf-v2-progress-label-font-weight);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.label {
|
|
36
|
+
min-width: 0;
|
|
37
|
+
font-size: var(--cf-v2-progress-label-font-size);
|
|
38
|
+
overflow-wrap: anywhere;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.value {
|
|
42
|
+
flex: none;
|
|
43
|
+
margin-inline-start: auto;
|
|
44
|
+
color: color-mix(in srgb, var(--cf-v2-on-surface) calc(var(--cf-v2-progress-value-opacity) * 100%), transparent);
|
|
45
|
+
font-size: var(--cf-v2-progress-value-font-size);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.track {
|
|
49
|
+
position: relative;
|
|
50
|
+
height: var(--cf-v2-progress-height);
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
border-radius: var(--cf-v2-progress-radius);
|
|
53
|
+
background: var(--cf-v2-surface-container);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.fill {
|
|
57
|
+
height: 100%;
|
|
58
|
+
border-radius: var(--cf-v2-progress-radius);
|
|
59
|
+
background: var(--progress-fill);
|
|
60
|
+
transition: width var(--cf-v2-progress-transition-duration) ease;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.moving {
|
|
64
|
+
position: absolute;
|
|
65
|
+
inset-block: 0;
|
|
66
|
+
width: var(--cf-v2-progress-segment-width);
|
|
67
|
+
animation: slide var(--cf-v2-progress-duration) ease-in-out infinite;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.circular {
|
|
71
|
+
position: relative;
|
|
72
|
+
display: inline-grid;
|
|
73
|
+
place-items: center;
|
|
74
|
+
width: var(--cf-v2-progress-ring-size);
|
|
75
|
+
height: var(--cf-v2-progress-ring-size);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.ring {
|
|
79
|
+
position: absolute;
|
|
80
|
+
inset: 0;
|
|
81
|
+
width: 100%;
|
|
82
|
+
height: 100%;
|
|
83
|
+
fill: none;
|
|
84
|
+
stroke-width: var(--cf-v2-progress-ring-stroke);
|
|
85
|
+
transform: rotate(-90deg);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.ringTrack {
|
|
89
|
+
stroke: var(--cf-v2-surface-container);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.ringArc {
|
|
93
|
+
stroke: var(--progress-fill);
|
|
94
|
+
stroke-linecap: round;
|
|
95
|
+
transform-box: fill-box;
|
|
96
|
+
transform-origin: center;
|
|
97
|
+
transition: stroke-dasharray var(--cf-v2-progress-transition-duration) ease;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.spin {
|
|
101
|
+
animation: spin var(--cf-v2-progress-duration) linear infinite;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.ringValue {
|
|
105
|
+
position: relative;
|
|
106
|
+
z-index: 1;
|
|
107
|
+
font-size: var(--cf-v2-progress-ring-font-size);
|
|
108
|
+
font-weight: var(--cf-v2-progress-ring-font-weight);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@keyframes slide {
|
|
112
|
+
from {
|
|
113
|
+
inset-inline-start: calc(-1 * var(--cf-v2-progress-segment-width));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
to {
|
|
117
|
+
inset-inline-start: 100%;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@keyframes spin {
|
|
122
|
+
to {
|
|
123
|
+
transform: rotate(360deg);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@media (prefers-reduced-motion: reduce) {
|
|
128
|
+
.fill,
|
|
129
|
+
.ringArc {
|
|
130
|
+
transition: none;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.moving,
|
|
134
|
+
.spin {
|
|
135
|
+
animation: none;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
@media (forced-colors: active) {
|
|
140
|
+
.track {
|
|
141
|
+
border: thin solid CanvasText;
|
|
142
|
+
background: Canvas;
|
|
143
|
+
forced-color-adjust: none;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.fill {
|
|
147
|
+
background: Highlight;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.ring {
|
|
151
|
+
forced-color-adjust: none;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.ringTrack {
|
|
155
|
+
stroke: GrayText;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.ringArc {
|
|
159
|
+
stroke: Highlight;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/componentsV2/feedback/ProgressV2/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ProgressV2 } from './ProgressV2';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import '@corefoundry-labs/forge-tokens/theme-v2/tokens.css';
|
|
2
|
+
import { type CSSProperties, type HTMLAttributes } from 'react';
|
|
3
|
+
export type SkeletonV2Shape = 'text' | 'rectangle' | 'circle';
|
|
4
|
+
export type SkeletonV2Size = 'sm' | 'md';
|
|
5
|
+
export type SkeletonV2Animation = 'none' | 'pulse' | 'wave';
|
|
6
|
+
export type SkeletonV2Props = Omit<HTMLAttributes<HTMLSpanElement>, 'children' | 'role'> & {
|
|
7
|
+
shape?: SkeletonV2Shape;
|
|
8
|
+
size?: SkeletonV2Size;
|
|
9
|
+
animation?: SkeletonV2Animation;
|
|
10
|
+
width?: CSSProperties['width'];
|
|
11
|
+
height?: CSSProperties['height'];
|
|
12
|
+
};
|
|
13
|
+
export declare const SkeletonV2: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLSpanElement>, "role" | "children"> & {
|
|
14
|
+
shape?: SkeletonV2Shape;
|
|
15
|
+
size?: SkeletonV2Size;
|
|
16
|
+
animation?: SkeletonV2Animation;
|
|
17
|
+
width?: CSSProperties["width"];
|
|
18
|
+
height?: CSSProperties["height"];
|
|
19
|
+
} & import("react").RefAttributes<HTMLSpanElement>>;
|
|
20
|
+
//# sourceMappingURL=SkeletonV2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkeletonV2.d.ts","sourceRoot":"","sources":["../../../../src/componentsV2/feedback/SkeletonV2/SkeletonV2.tsx"],"names":[],"mappings":"AAAA,OAAO,oDAAoD,CAAC;AAC5D,OAAO,EAAc,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5E,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;AAC9D,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,CAAC;AACzC,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAE5D,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC,GAAG;IACzF,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,SAAS,CAAC,EAAE,mBAAmB,CAAC;IAChC,KAAK,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC/B,MAAM,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,UAAU;YAPb,eAAe;WAChB,cAAc;gBACT,mBAAmB;YACvB,aAAa,CAAC,OAAO,CAAC;aACrB,aAAa,CAAC,QAAQ,CAAC;mDAqBhC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import '@corefoundry-labs/forge-tokens/theme-v2/tokens.css';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import styles from './SkeletonV2.module.css';
|
|
5
|
+
export const SkeletonV2 = forwardRef(function SkeletonV2({ shape = 'text', size = 'sm', animation = 'none', width, height, className, style, ...props }, ref) {
|
|
6
|
+
const sized = { ...(width !== undefined && { width }), ...(height !== undefined && { height }), ...style };
|
|
7
|
+
return (_jsx("span", { ...props, ref: ref, "aria-hidden": "true", "data-shape": shape, "data-size": size, "data-animation": animation, style: sized, className: [styles.skeleton, styles[shape], styles[size], styles[animation], className].filter(Boolean).join(' ') }));
|
|
8
|
+
});
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
.skeleton {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: block;
|
|
4
|
+
flex: none;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
max-width: 100%;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
background: var(--cf-v2-surface-container-hover);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.text.sm {
|
|
12
|
+
width: var(--cf-v2-skeleton-text-width-sm);
|
|
13
|
+
height: var(--cf-v2-skeleton-text-height-sm);
|
|
14
|
+
border-radius: var(--cf-v2-skeleton-text-radius-sm);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.text.md {
|
|
18
|
+
width: var(--cf-v2-skeleton-text-width-md);
|
|
19
|
+
height: var(--cf-v2-skeleton-text-height-md);
|
|
20
|
+
border-radius: var(--cf-v2-skeleton-text-radius-md);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.rectangle {
|
|
24
|
+
border-radius: var(--cf-v2-skeleton-rectangle-radius);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.rectangle.sm {
|
|
28
|
+
width: var(--cf-v2-skeleton-rectangle-width-sm);
|
|
29
|
+
height: var(--cf-v2-skeleton-rectangle-height-sm);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.rectangle.md {
|
|
33
|
+
width: var(--cf-v2-skeleton-rectangle-width-md);
|
|
34
|
+
height: var(--cf-v2-skeleton-rectangle-height-md);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.circle {
|
|
38
|
+
border-radius: 50%;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.circle.sm {
|
|
42
|
+
width: var(--cf-v2-skeleton-circle-size-sm);
|
|
43
|
+
height: var(--cf-v2-skeleton-circle-size-sm);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.circle.md {
|
|
47
|
+
width: var(--cf-v2-skeleton-circle-size-md);
|
|
48
|
+
height: var(--cf-v2-skeleton-circle-size-md);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.pulse {
|
|
52
|
+
animation: pulse var(--cf-v2-skeleton-duration) ease-in-out infinite;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.wave::after {
|
|
56
|
+
position: absolute;
|
|
57
|
+
inset: 0;
|
|
58
|
+
background: linear-gradient(90deg, transparent, var(--cf-v2-surface-container-pressed), transparent);
|
|
59
|
+
content: '';
|
|
60
|
+
transform: translateX(-100%);
|
|
61
|
+
animation: wave var(--cf-v2-skeleton-duration) ease-in-out infinite;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@keyframes pulse {
|
|
65
|
+
50% {
|
|
66
|
+
opacity: var(--cf-v2-skeleton-pulse-opacity);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@keyframes wave {
|
|
71
|
+
to {
|
|
72
|
+
transform: translateX(100%);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@media (prefers-reduced-motion: reduce) {
|
|
77
|
+
.pulse,
|
|
78
|
+
.wave::after {
|
|
79
|
+
animation: none;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.wave::after {
|
|
83
|
+
display: none;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@media (forced-colors: active) {
|
|
88
|
+
.skeleton {
|
|
89
|
+
background: GrayText;
|
|
90
|
+
forced-color-adjust: none;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/componentsV2/feedback/SkeletonV2/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SkeletonV2 } from './SkeletonV2';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import '@corefoundry-labs/forge-tokens/theme-v2/tokens.css';
|
|
2
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
3
|
+
export type SnackbarV2Tone = 'neutral' | 'info' | 'success' | 'warning' | 'error';
|
|
4
|
+
export type SnackbarV2Density = 'compact' | 'detailed';
|
|
5
|
+
export type SnackbarV2DismissReason = 'timeout' | 'close';
|
|
6
|
+
export type SnackbarStackV2Placement = 'bottom-center' | 'bottom-end';
|
|
7
|
+
export type SnackbarV2Props = Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'children'> & {
|
|
8
|
+
title: ReactNode;
|
|
9
|
+
description?: ReactNode;
|
|
10
|
+
tone?: SnackbarV2Tone;
|
|
11
|
+
density?: SnackbarV2Density;
|
|
12
|
+
action?: ReactNode;
|
|
13
|
+
dismissible?: boolean;
|
|
14
|
+
dismissLabel?: string;
|
|
15
|
+
duration?: number | null;
|
|
16
|
+
onDismiss?: (reason: SnackbarV2DismissReason) => void;
|
|
17
|
+
};
|
|
18
|
+
export type SnackbarStackV2Props = Omit<HTMLAttributes<HTMLDivElement>, 'role' | 'popover'> & {
|
|
19
|
+
placement?: SnackbarStackV2Placement;
|
|
20
|
+
};
|
|
21
|
+
export declare const SnackbarV2: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title" | "children"> & {
|
|
22
|
+
title: ReactNode;
|
|
23
|
+
description?: ReactNode;
|
|
24
|
+
tone?: SnackbarV2Tone;
|
|
25
|
+
density?: SnackbarV2Density;
|
|
26
|
+
action?: ReactNode;
|
|
27
|
+
dismissible?: boolean;
|
|
28
|
+
dismissLabel?: string;
|
|
29
|
+
duration?: number | null;
|
|
30
|
+
onDismiss?: (reason: SnackbarV2DismissReason) => void;
|
|
31
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
32
|
+
export declare const SnackbarStackV2: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "role" | "popover"> & {
|
|
33
|
+
placement?: SnackbarStackV2Placement;
|
|
34
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
35
|
+
//# sourceMappingURL=SnackbarV2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SnackbarV2.d.ts","sourceRoot":"","sources":["../../../../src/componentsV2/feedback/SnackbarV2/SnackbarV2.tsx"],"names":[],"mappings":"AAAA,OAAO,oDAAoD,CAAC;AAE5D,OAAO,EAUL,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAClF,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,UAAU,CAAC;AACvD,MAAM,MAAM,uBAAuB,GAAG,SAAS,GAAG,OAAO,CAAC;AAC1D,MAAM,MAAM,wBAAwB,GAAG,eAAe,GAAG,YAAY,CAAC;AAEtE,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,GAAG;IACzF,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,uBAAuB,KAAK,IAAI,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG;IAC5F,SAAS,CAAC,EAAE,wBAAwB,CAAC;CACtC,CAAC;AAKF,eAAO,MAAM,UAAU;WAlBd,SAAS;kBACF,SAAS;WAChB,cAAc;cACX,iBAAiB;aAClB,SAAS;kBACJ,OAAO;mBACN,MAAM;eACV,MAAM,GAAG,IAAI;gBACZ,CAAC,MAAM,EAAE,uBAAuB,KAAK,IAAI;kDAmIrD,CAAC;AAEH,eAAO,MAAM,eAAe;gBAjId,wBAAwB;kDA6JpC,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import '@corefoundry-labs/forge-tokens/theme-v2/tokens.css';
|
|
3
|
+
import { Close } from '@corefoundry-labs/forge-icons';
|
|
4
|
+
import { createContext, forwardRef, useCallback, useContext, useEffect, useImperativeHandle, useLayoutEffect, useRef, } from 'react';
|
|
5
|
+
import { chain, useLatest, useOpenLifecycle } from '../../overlays/layer';
|
|
6
|
+
import styles from './SnackbarV2.module.css';
|
|
7
|
+
const defaultDuration = 5000;
|
|
8
|
+
const StackContext = createContext(false);
|
|
9
|
+
export const SnackbarV2 = forwardRef(function SnackbarV2({ title, description, tone = 'neutral', density = 'compact', action, dismissible = true, dismissLabel = 'Dismiss', duration = action != null || tone === 'error' ? null : defaultDuration, onDismiss, role, className, onPointerEnter, onPointerLeave, onFocus, onBlur, ...props }, ref) {
|
|
10
|
+
const stacked = useContext(StackContext);
|
|
11
|
+
const liveRole = stacked ? undefined : 'status';
|
|
12
|
+
const rootRef = useRef(null);
|
|
13
|
+
const dismiss = useLatest(onDismiss);
|
|
14
|
+
const timer = useRef(undefined);
|
|
15
|
+
const remaining = useRef(null);
|
|
16
|
+
const startedAt = useRef(0);
|
|
17
|
+
const pauses = useRef(new Set());
|
|
18
|
+
const returnTo = useRef(null);
|
|
19
|
+
useImperativeHandle(ref, () => rootRef.current);
|
|
20
|
+
const run = useCallback(() => {
|
|
21
|
+
if (timer.current !== undefined || pauses.current.size > 0 || remaining.current === null)
|
|
22
|
+
return;
|
|
23
|
+
startedAt.current = Date.now();
|
|
24
|
+
timer.current = setTimeout(() => {
|
|
25
|
+
timer.current = undefined;
|
|
26
|
+
remaining.current = null;
|
|
27
|
+
dismiss.current?.('timeout');
|
|
28
|
+
}, remaining.current);
|
|
29
|
+
}, [dismiss]);
|
|
30
|
+
const pause = useCallback((reason) => {
|
|
31
|
+
pauses.current.add(reason);
|
|
32
|
+
if (rootRef.current)
|
|
33
|
+
rootRef.current.dataset.paused = 'true';
|
|
34
|
+
if (timer.current === undefined || remaining.current === null)
|
|
35
|
+
return;
|
|
36
|
+
clearTimeout(timer.current);
|
|
37
|
+
timer.current = undefined;
|
|
38
|
+
remaining.current = Math.max(remaining.current - (Date.now() - startedAt.current), 0);
|
|
39
|
+
}, []);
|
|
40
|
+
const resume = useCallback((reason) => {
|
|
41
|
+
pauses.current.delete(reason);
|
|
42
|
+
if (pauses.current.size === 0 && rootRef.current)
|
|
43
|
+
delete rootRef.current.dataset.paused;
|
|
44
|
+
run();
|
|
45
|
+
}, [run]);
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
remaining.current = duration;
|
|
48
|
+
if (document.hidden)
|
|
49
|
+
pause('hidden');
|
|
50
|
+
run();
|
|
51
|
+
return () => {
|
|
52
|
+
clearTimeout(timer.current);
|
|
53
|
+
timer.current = undefined;
|
|
54
|
+
};
|
|
55
|
+
}, [duration, pause, run]);
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
const sync = () => (document.hidden ? pause('hidden') : resume('hidden'));
|
|
58
|
+
document.addEventListener('visibilitychange', sync);
|
|
59
|
+
return () => document.removeEventListener('visibilitychange', sync);
|
|
60
|
+
}, [pause, resume]);
|
|
61
|
+
useLayoutEffect(() => {
|
|
62
|
+
const node = rootRef.current;
|
|
63
|
+
return () => {
|
|
64
|
+
const target = returnTo.current;
|
|
65
|
+
if (node?.contains(document.activeElement) && target instanceof HTMLElement) {
|
|
66
|
+
target.focus({ preventScroll: true });
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}, []);
|
|
70
|
+
const focusIn = (event) => {
|
|
71
|
+
if (!event.currentTarget.contains(event.relatedTarget))
|
|
72
|
+
returnTo.current = event.relatedTarget;
|
|
73
|
+
pause('focus');
|
|
74
|
+
};
|
|
75
|
+
const focusOut = (event) => {
|
|
76
|
+
if (!event.currentTarget.contains(event.relatedTarget))
|
|
77
|
+
resume('focus');
|
|
78
|
+
};
|
|
79
|
+
return (_jsxs("div", { ...props, ref: rootRef, role: role ?? (tone === 'error' ? 'alert' : liveRole), "data-tone": tone, "data-density": density, onPointerEnter: chain(onPointerEnter, () => pause('hover')), onPointerLeave: chain(onPointerLeave, () => resume('hover')), onFocus: chain(onFocus, focusIn), onBlur: chain(onBlur, focusOut), className: [styles.snackbar, styles[tone], styles[density], className].filter(Boolean).join(' '), children: [_jsx("span", { className: styles.indicator, "aria-hidden": "true" }), _jsxs("div", { className: styles.text, children: [_jsx("div", { className: styles.title, children: title }), description != null && _jsx("div", { className: styles.description, children: description })] }), action != null && _jsx("div", { className: styles.action, children: action }), dismissible && onDismiss && (_jsx("button", { type: "button", className: styles.dismiss, "aria-label": dismissLabel, onClick: () => onDismiss('close'), children: _jsx(Close, { "aria-hidden": "true" }) }))] }));
|
|
80
|
+
});
|
|
81
|
+
export const SnackbarStackV2 = forwardRef(function SnackbarStackV2({ placement = 'bottom-center', 'aria-label': label = 'Notifications', className, children, ...props }, ref) {
|
|
82
|
+
const stackRef = useRef(null);
|
|
83
|
+
useImperativeHandle(ref, () => stackRef.current);
|
|
84
|
+
useOpenLifecycle(true, () => {
|
|
85
|
+
const stack = stackRef.current;
|
|
86
|
+
stack?.showPopover?.();
|
|
87
|
+
return () => stack?.hidePopover?.();
|
|
88
|
+
});
|
|
89
|
+
return (_jsx("div", { ...props, ref: stackRef, role: "region", "aria-label": label, "aria-live": "polite", "aria-relevant": "additions", popover: "manual", "data-placement": placement, className: [styles.stack, styles[placement === 'bottom-end' ? 'end' : 'center'], className].filter(Boolean).join(' '), children: _jsx(StackContext.Provider, { value: true, children: children }) }));
|
|
90
|
+
});
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
.snackbar {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: var(--cf-v2-snackbar-gap);
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
padding-block: var(--cf-v2-snackbar-padding-block);
|
|
7
|
+
padding-inline: var(--cf-v2-snackbar-padding-start) var(--cf-v2-snackbar-padding-end);
|
|
8
|
+
border: var(--cf-v2-snackbar-border-width) solid var(--cf-v2-outline);
|
|
9
|
+
border-radius: var(--cf-v2-snackbar-radius);
|
|
10
|
+
background: var(--cf-v2-surface-container);
|
|
11
|
+
color: var(--cf-v2-on-surface);
|
|
12
|
+
font-family: inherit;
|
|
13
|
+
line-height: normal;
|
|
14
|
+
animation: enter var(--cf-v2-snackbar-enter-duration) ease-out;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.compact {
|
|
18
|
+
width: min(var(--cf-v2-snackbar-width-compact), 100%);
|
|
19
|
+
min-height: var(--cf-v2-snackbar-min-height-compact);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.detailed {
|
|
23
|
+
width: min(var(--cf-v2-snackbar-width-detailed), 100%);
|
|
24
|
+
min-height: var(--cf-v2-snackbar-min-height-detailed);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.neutral {
|
|
28
|
+
--snackbar-tone: var(--cf-v2-on-surface);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.info {
|
|
32
|
+
--snackbar-tone: var(--cf-v2-info);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.success {
|
|
36
|
+
--snackbar-tone: var(--cf-v2-success);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.warning {
|
|
40
|
+
--snackbar-tone: var(--cf-v2-warning);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.error {
|
|
44
|
+
--snackbar-tone: var(--cf-v2-error);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.indicator {
|
|
48
|
+
flex: none;
|
|
49
|
+
width: var(--cf-v2-snackbar-indicator-size);
|
|
50
|
+
height: var(--cf-v2-snackbar-indicator-size);
|
|
51
|
+
border-radius: 50%;
|
|
52
|
+
background: var(--snackbar-tone);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.text {
|
|
56
|
+
display: flex;
|
|
57
|
+
flex: 1 1 auto;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
gap: var(--cf-v2-snackbar-text-gap);
|
|
60
|
+
min-width: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.title {
|
|
64
|
+
font-size: var(--cf-v2-snackbar-title-font-size);
|
|
65
|
+
font-weight: var(--cf-v2-snackbar-title-font-weight);
|
|
66
|
+
overflow-wrap: anywhere;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.description {
|
|
70
|
+
color: color-mix(in srgb, var(--cf-v2-on-surface) calc(var(--cf-v2-snackbar-description-opacity) * 100%), transparent);
|
|
71
|
+
font-size: var(--cf-v2-snackbar-description-font-size);
|
|
72
|
+
overflow-wrap: anywhere;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.action {
|
|
76
|
+
display: inline-flex;
|
|
77
|
+
flex: none;
|
|
78
|
+
align-items: center;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.dismiss {
|
|
82
|
+
display: inline-flex;
|
|
83
|
+
flex: none;
|
|
84
|
+
align-items: center;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
width: var(--cf-v2-snackbar-dismiss-size);
|
|
87
|
+
height: var(--cf-v2-snackbar-dismiss-size);
|
|
88
|
+
margin: 0;
|
|
89
|
+
padding: 0;
|
|
90
|
+
border: 0;
|
|
91
|
+
border-radius: var(--cf-v2-snackbar-dismiss-radius);
|
|
92
|
+
background: transparent;
|
|
93
|
+
color: inherit;
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.dismiss svg {
|
|
98
|
+
width: var(--cf-v2-snackbar-dismiss-icon-size);
|
|
99
|
+
height: var(--cf-v2-snackbar-dismiss-icon-size);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.dismiss:hover {
|
|
103
|
+
background: var(--cf-v2-surface-container-hover);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.dismiss:focus-visible {
|
|
107
|
+
outline: var(--cf-v2-snackbar-focus-width) solid var(--cf-v2-focus-ring);
|
|
108
|
+
outline-offset: calc(-1 * var(--cf-v2-snackbar-focus-width));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.stack {
|
|
112
|
+
position: fixed;
|
|
113
|
+
inset: auto;
|
|
114
|
+
bottom: var(--cf-v2-overlay-viewport-margin);
|
|
115
|
+
display: flex;
|
|
116
|
+
flex-direction: column;
|
|
117
|
+
gap: var(--cf-v2-snackbar-stack-gap);
|
|
118
|
+
box-sizing: border-box;
|
|
119
|
+
width: calc(100vw - 2 * var(--cf-v2-overlay-viewport-margin));
|
|
120
|
+
margin: 0;
|
|
121
|
+
padding: 0;
|
|
122
|
+
overflow: visible;
|
|
123
|
+
border: 0;
|
|
124
|
+
background: transparent;
|
|
125
|
+
color: var(--cf-v2-on-surface);
|
|
126
|
+
pointer-events: none;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.stack > * {
|
|
130
|
+
pointer-events: auto;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.center {
|
|
134
|
+
inset-inline: 0;
|
|
135
|
+
align-items: center;
|
|
136
|
+
margin-inline: auto;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.end {
|
|
140
|
+
inset-inline-end: var(--cf-v2-overlay-viewport-margin);
|
|
141
|
+
align-items: flex-end;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@keyframes enter {
|
|
145
|
+
from {
|
|
146
|
+
opacity: 0;
|
|
147
|
+
transform: translateY(var(--cf-v2-snackbar-enter-offset));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
@media (prefers-reduced-motion: reduce) {
|
|
152
|
+
.snackbar {
|
|
153
|
+
animation: none;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
@media (forced-colors: active) {
|
|
158
|
+
.indicator {
|
|
159
|
+
background: CanvasText;
|
|
160
|
+
forced-color-adjust: none;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/componentsV2/feedback/SnackbarV2/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC3D,YAAY,EACV,wBAAwB,EACxB,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,eAAe,EACf,cAAc,GACf,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SnackbarStackV2, SnackbarV2 } from './SnackbarV2';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import '@corefoundry-labs/forge-tokens/theme-v2/tokens.css';
|
|
2
|
+
import { type InputHTMLAttributes } from 'react';
|
|
3
|
+
import type { SelectionControlName } from '../selectionControl';
|
|
4
|
+
type CheckboxV2Base = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size' | 'children'> & {
|
|
5
|
+
indeterminate?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export type CheckboxV2Props = CheckboxV2Base & SelectionControlName;
|
|
8
|
+
export declare const CheckboxV2: import("react").ForwardRefExoticComponent<CheckboxV2Props & import("react").RefAttributes<HTMLInputElement>>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=CheckboxV2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckboxV2.d.ts","sourceRoot":"","sources":["../../../../src/componentsV2/forms/CheckboxV2/CheckboxV2.tsx"],"names":[],"mappings":"AAAA,OAAO,oDAAoD,CAAC;AAC5D,OAAO,EAML,KAAK,mBAAmB,EACzB,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAGhE,KAAK,cAAc,GAAG,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC,GAAG;IAChG,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG,oBAAoB,CAAC;AAEpE,eAAO,MAAM,UAAU,8GA2CrB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import '@corefoundry-labs/forge-tokens/theme-v2/tokens.css';
|
|
3
|
+
import { forwardRef, useEffect, useImperativeHandle, useRef, } from 'react';
|
|
4
|
+
import styles from './CheckboxV2.module.css';
|
|
5
|
+
export const CheckboxV2 = forwardRef(function CheckboxV2({ indeterminate = false, className, style, children, onChange, ...props }, ref) {
|
|
6
|
+
const inputRef = useRef(null);
|
|
7
|
+
useImperativeHandle(ref, () => inputRef.current, []);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (inputRef.current)
|
|
10
|
+
inputRef.current.indeterminate = indeterminate;
|
|
11
|
+
}, [indeterminate]);
|
|
12
|
+
const handleChange = (event) => {
|
|
13
|
+
event.currentTarget.indeterminate = indeterminate;
|
|
14
|
+
onChange?.(event);
|
|
15
|
+
};
|
|
16
|
+
const Root = children == null ? 'span' : 'label';
|
|
17
|
+
return (_jsxs(Root, { className: [styles.root, className].filter(Boolean).join(' '), style: style, "data-disabled": props.disabled || undefined, children: [_jsxs("span", { className: styles.target, children: [_jsx("input", { ...props, ref: inputRef, type: "checkbox", onChange: handleChange, className: styles.input }), _jsxs("span", { className: styles.box, "aria-hidden": "true", children: [_jsx("svg", { className: styles.check, viewBox: "0 0 20 20", fill: "none", children: _jsx("path", { d: "M4 10L8.2 14.2L16 6", stroke: "currentColor", strokeWidth: "2.4", strokeLinecap: "round", strokeLinejoin: "round" }) }), _jsx("svg", { className: styles.mixed, viewBox: "0 0 20 20", fill: "none", children: _jsx("path", { d: "M4 10H16", stroke: "currentColor", strokeWidth: "2.4", strokeLinecap: "round", strokeLinejoin: "round" }) })] })] }), children != null && _jsx("span", { className: styles.label, children: children })] }));
|
|
18
|
+
});
|