@rescui/card 0.10.11 → 0.10.12-RUI-226-Update-card-cn-6e43cc89.60

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/lib/card.d.ts CHANGED
@@ -1,54 +1,62 @@
1
1
  export declare type CardIsClickable = boolean;
2
2
  export declare type CardTheme = 'light' | 'dark';
3
3
  export declare type CardMode = 'classic' | 'rock';
4
- export declare type CardPaddings = 16 | 24 | 32;
4
+ export declare type CardPaddings = 0 | 16 | 24 | 32;
5
5
  export declare type CardBorderRadius = 0 | 8 | 16 | 24;
6
6
  export declare type CardGlowHover = boolean;
7
7
  export declare type CardImageType = 'cardImageImg' | 'cardImageDiv';
8
8
  export declare type CardProps = {
9
- /** Card clickable property
9
+ /** Clickable property
10
10
  * @default false
11
11
  * */
12
12
  isClickable?: CardIsClickable;
13
13
  /** Appearance theme
14
- * @default light
14
+ * @default auto
15
15
  * */
16
16
  theme?: CardTheme;
17
- /** Appearance mode
17
+ /** Appearance mode, only works for `clickable` cards
18
18
  * @default classic
19
19
  * */
20
20
  mode?: CardMode;
21
21
  /** Appearance paddings
22
22
  * @default 24
23
23
  * */
24
+ padding?: CardPaddings;
25
+ /**
26
+ * @default 24
27
+ * @deprecated use `padding` instead
28
+ * */
24
29
  paddings?: CardPaddings;
25
30
  /** Card borders style
26
31
  * @default 8
27
32
  * */
28
33
  borderRadius?: CardBorderRadius;
29
- /** Card has glowHover effect provided by `useGlowHover` hook
34
+ /**
30
35
  * @default false
36
+ * @deprecated with latest `@rescui/use-glow-hover` version it resolves automatically
31
37
  * */
32
38
  hasGlowHover?: CardGlowHover;
33
- /** Disable border for all cases except isClickable without glow-hover
39
+ /** Disables border
34
40
  * @default false
35
41
  * */
36
42
  disableBorder?: boolean;
37
43
  };
38
44
  export declare type CardImgType = {
39
- /**
45
+ /** Sets type of image in a card
40
46
  * @default cardImageDiv
41
47
  * */
42
48
  cardImageType?: CardImageType;
43
- /** Disable predefined image height, if you use this prop you should manually equalize image heights between cards on one row/group
49
+ /** Disable predefined image height, when using this prop manually equalize image heights within cards in one row or group
44
50
  * @default false
45
51
  * */
46
52
  disableFixedHeight?: boolean;
47
- /** Disable image stretching to the card width. Applied only to the `cardImageImg` card image type.
53
+ /** Disable stretching the image to the card width, only applies to the `cardImageImg` card image type
48
54
  * @default false
49
55
  * */
50
56
  disableFullWidth?: boolean;
51
57
  };
52
- export declare const cardCn: ({ isClickable, theme, mode, paddings, borderRadius, hasGlowHover, disableBorder }?: CardProps) => string;
58
+ export declare const cardLinkCn: () => any;
59
+ export declare const cardButtonCn: () => any;
60
+ export declare const cardCn: ({ isClickable, theme, mode, padding, borderRadius, disableBorder, paddings, hasGlowHover }?: CardProps) => string;
53
61
  export declare const cardImageCn: ({ cardImageType, disableFixedHeight, disableFullWidth }: CardImgType) => string;
54
62
  export declare const useCardCn: () => (cardCnOptions?: CardProps) => string;
package/lib/card.js CHANGED
@@ -1,6 +1,11 @@
1
1
  import cn from 'classnames';
2
2
  import { useThemeWithUndefined } from '@rescui/ui-contexts';
3
3
  import styles from './card.p.module.css.js';
4
+
5
+ const cardLinkCn = () => styles.innerLink;
6
+
7
+ const cardButtonCn = () => styles.innerButton;
8
+
4
9
  const THEME_STYLES = {
5
10
  light: styles.themeLight,
6
11
  dark: styles.themeDark
@@ -9,16 +14,17 @@ const MODE_STYLES = {
9
14
  classic: styles.modeClassic,
10
15
  rock: styles.modeRock
11
16
  };
12
- const PADDINGS_STYLES = {
13
- 16: styles.paddings16,
14
- 24: styles.paddings24,
15
- 32: styles.paddings32
17
+ const PADDING_STYLES = {
18
+ 0: styles.padding0,
19
+ 16: styles.padding16,
20
+ 24: styles.padding24,
21
+ 32: styles.padding32
16
22
  };
17
23
  const BORDER_RADIUS_STYLES = {
18
- 0: styles.bordersRadius0,
19
- 8: styles.bordersRadius8,
20
- 16: styles.bordersRadius16,
21
- 24: styles.bordersRadius24
24
+ 0: styles.borderRadius0,
25
+ 8: styles.borderRadius8,
26
+ 16: styles.borderRadius16,
27
+ 24: styles.borderRadius24
22
28
  };
23
29
  const CARD_IMAGE_STYLES = {
24
30
  cardImageImg: styles.cardImageImg,
@@ -30,22 +36,17 @@ const cardCn = function () {
30
36
  isClickable,
31
37
  theme,
32
38
  mode,
33
- paddings,
39
+ padding,
34
40
  borderRadius,
35
- hasGlowHover,
36
- disableBorder
41
+ disableBorder,
42
+ paddings,
43
+ hasGlowHover
37
44
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
38
45
  const themeClass = THEME_STYLES[theme] ?? '';
39
46
  const modeClass = MODE_STYLES[mode] ?? MODE_STYLES.classic;
40
- const paddingsClass = PADDINGS_STYLES[paddings] ?? PADDINGS_STYLES[24];
47
+ const paddingClass = PADDING_STYLES[padding ?? paddings] ?? PADDING_STYLES[24];
41
48
  const borderRadiusClass = BORDER_RADIUS_STYLES[borderRadius] ?? BORDER_RADIUS_STYLES[8];
42
- const showBorderStatesClass = isClickable && (!disableBorder || !hasGlowHover);
43
- return cn(styles.card, themeClass, modeClass, paddingsClass, borderRadiusClass, {
44
- [styles.cardPlain]: !isClickable,
45
- [styles.glowHover]: hasGlowHover,
46
- [styles.withStaticBorder]: !disableBorder,
47
- [styles.withStatesBorder]: showBorderStatesClass
48
- });
49
+ return cn(isClickable ? styles.clickable : styles.tile, themeClass, isClickable ? modeClass : MODE_STYLES.classic, paddingClass, borderRadiusClass, hasGlowHover && styles.hasGlowHover, disableBorder && styles.disableBorder);
49
50
  };
50
51
 
51
52
  const cardImageCn = _ref => {
@@ -66,4 +67,4 @@ const useCardCn = () => {
66
67
  });
67
68
  };
68
69
 
69
- export { cardCn, cardImageCn, useCardCn };
70
+ export { cardButtonCn, cardCn, cardImageCn, cardLinkCn, useCardCn };
@@ -1,24 +1,26 @@
1
1
  var styles = {
2
- "card": "_card_12rk3bb_6",
3
- "themeLight": "_themeLight_12rk3bb_47",
4
- "themeDark": "_themeDark_12rk3bb_52",
5
- "withStaticBorder": "_withStaticBorder_12rk3bb_56",
6
- "cardPlain": "_cardPlain_12rk3bb_60",
7
- "modeClassic": "_modeClassic_12rk3bb_60",
8
- "modeRock": "_modeRock_12rk3bb_61",
9
- "withStatesBorder": "_withStatesBorder_12rk3bb_66",
10
- "paddings16": "_paddings16_12rk3bb_95",
11
- "paddings24": "_paddings24_12rk3bb_99",
12
- "paddings32": "_paddings32_12rk3bb_103",
13
- "glowHover": "_glowHover_12rk3bb_71",
14
- "bordersRadius0": "_bordersRadius0_12rk3bb_107",
15
- "bordersRadius8": "_bordersRadius8_12rk3bb_111",
16
- "bordersRadius16": "_bordersRadius16_12rk3bb_115",
17
- "bordersRadius24": "_bordersRadius24_12rk3bb_119",
18
- "cardImage": "_cardImage_12rk3bb_123",
19
- "cardImageImg": "_cardImageImg_12rk3bb_131",
20
- "cardImageDiv": "_cardImageDiv_12rk3bb_165",
21
- "fixedImageHeight": "_fixedImageHeight_12rk3bb_200",
22
- "fullImageWidth": "_fullImageWidth_12rk3bb_218"
2
+ "themeLight": "_themeLight_1cx2pa_8",
3
+ "themeDark": "_themeDark_1cx2pa_11",
4
+ "padding0": "_padding0_1cx2pa_15",
5
+ "padding16": "_padding16_1cx2pa_18",
6
+ "padding24": "_padding24_1cx2pa_21",
7
+ "padding32": "_padding32_1cx2pa_24",
8
+ "borderRadius0": "_borderRadius0_1cx2pa_28",
9
+ "borderRadius8": "_borderRadius8_1cx2pa_31",
10
+ "borderRadius16": "_borderRadius16_1cx2pa_34",
11
+ "borderRadius24": "_borderRadius24_1cx2pa_37",
12
+ "modeClassic": "_modeClassic_1cx2pa_41",
13
+ "modeRock": "_modeRock_1cx2pa_50",
14
+ "clickable": "_clickable_1cx2pa_120",
15
+ "disableBorder": "_disableBorder_1cx2pa_77",
16
+ "hasGlowHover": "_hasGlowHover_1cx2pa_81",
17
+ "tile": "_tile_1cx2pa_241",
18
+ "fixedImageHeight": "_fixedImageHeight_1cx2pa_295",
19
+ "fullImageWidth": "_fullImageWidth_1cx2pa_304",
20
+ "cardImage": "_cardImage_1cx2pa_308",
21
+ "cardImageImg": "_cardImageImg_1cx2pa_316",
22
+ "cardImageDiv": "_cardImageDiv_1cx2pa_341",
23
+ "innerLink": "_innerLink_1cx2pa_366",
24
+ "innerButton": "_innerButton_1cx2pa_378"
23
25
  };
24
26
  export { styles as default };
package/lib/index.css CHANGED
@@ -1,4 +1,64 @@
1
- ._card_12rk3bb_6{
1
+ ._themeLight_1cx2pa_8{
2
+ --rs-theme-dark:0;
3
+ }
4
+
5
+ ._themeDark_1cx2pa_11{
6
+ --rs-theme-dark:1;
7
+ }
8
+
9
+ ._padding0_1cx2pa_15{
10
+ --_rs-card-padding:0px;
11
+ }
12
+
13
+ ._padding16_1cx2pa_18{
14
+ --_rs-card-padding:16px;
15
+ }
16
+
17
+ ._padding24_1cx2pa_21{
18
+ --_rs-card-padding:24px;
19
+ }
20
+
21
+ ._padding32_1cx2pa_24{
22
+ --_rs-card-padding:32px;
23
+ }
24
+
25
+ ._borderRadius0_1cx2pa_28{
26
+ --_rs-card-border-radius:0px;
27
+ }
28
+
29
+ ._borderRadius8_1cx2pa_31{
30
+ --_rs-card-border-radius:8px;
31
+ }
32
+
33
+ ._borderRadius16_1cx2pa_34{
34
+ --_rs-card-border-radius:16px;
35
+ }
36
+
37
+ ._borderRadius24_1cx2pa_37{
38
+ --_rs-card-border-radius:24px;
39
+ }
40
+
41
+ ._modeClassic_1cx2pa_41{
42
+ --_rs-card-states-theme-flip:0;
43
+
44
+ --_rs-card-hover-focus-border-width:1px;
45
+ --_rs-card-active-border-width:2px;
46
+
47
+ --_rs-card-hover-focus-background:rgb(calc(255 - var(--_rs-theme-dark-coefficient, 0)*207), calc(255 - var(--_rs-theme-dark-coefficient, 0)*207), calc(255 - var(--_rs-theme-dark-coefficient, 0)*204));
48
+ --_rs-card-active-background:rgb(calc(255 - var(--_rs-theme-dark-coefficient, 0)*207), calc(255 - var(--_rs-theme-dark-coefficient, 0)*207), calc(255 - var(--_rs-theme-dark-coefficient, 0)*204));
49
+ }
50
+
51
+ ._modeRock_1cx2pa_50{
52
+ --_rs-card-states-theme-flip:1;
53
+
54
+ --_rs-card-hover-focus-border-width:0px;
55
+ --_rs-card-active-border-width:0px;
56
+
57
+ --_rs-card-hover-focus-background:rgb(calc(255 - var(--_rs-theme-dark-coefficient, 0)*230), calc(255 - var(--_rs-theme-dark-coefficient, 0)*230), calc(255 - var(--_rs-theme-dark-coefficient, 0)*227));
58
+ --_rs-card-active-background:rgb(calc(244 - var(--_rs-theme-dark-coefficient, 0)*196), calc(244 - var(--_rs-theme-dark-coefficient, 0)*196), calc(244 - var(--_rs-theme-dark-coefficient, 0)*193));
59
+ }
60
+
61
+ ._clickable_1cx2pa_120{
2
62
  --_rs-theme-dark:var(
3
63
  --_rs-internal-force-theme-dark-consult-rescui-before-using,
4
64
  var(--rs-theme-dark, 0)
@@ -6,206 +66,365 @@
6
66
  --_rs-theme-flip:var(--rs-theme-flip, 0);
7
67
  --_rs-theme-dark-coefficient:calc(var(--_rs-theme-dark)*(1 - var(--_rs-theme-flip)) + var(--_rs-theme-flip)*(1 - var(--_rs-theme-dark)));
8
68
  --_rs-theme-light-coefficient:calc(1 - var(--_rs-theme-dark-coefficient));
69
+ --_rs-card-native-base-border-width:1px;
70
+ --_rs-card-native-hover-border-width:var(
71
+ --_rs-card-hover-focus-border-width
72
+ );
73
+ --_rs-card-native-hover-border-color:rgb(calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227));
74
+ --_rs-card-native-focus-border-width:var(
75
+ --_rs-card-hover-focus-border-width
76
+ );
77
+ --_rs-card-native-focus-border-color:rgb(calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227));
78
+ --_rs-card-native-active-border-width:var(--_rs-card-active-border-width);
79
+ --_rs-card-native-active-border-color:rgb(calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227));
80
+ }
81
+
82
+ ._clickable_1cx2pa_120._disableBorder_1cx2pa_77{
83
+ --_rs-card-native-base-border-width:0px;
84
+ }
85
+
86
+ ._clickable_1cx2pa_120:is([data-extra-hover-effect], ._hasGlowHover_1cx2pa_81){
87
+ --_rs-card-native-hover-border-width:1px;
88
+ --_rs-card-native-hover-border-color:rgba(
89
+ calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227),
90
+ 0.2
91
+ );
92
+
93
+ --_rs-card-native-focus-border-width:1px;
94
+
95
+ --_rs-card-native-active-border-width:2px;
96
+ --_rs-card-native-active-border-color:rgb(
97
+ calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227)
98
+ );
99
+ }
100
+
101
+ ._clickable_1cx2pa_120:is([data-extra-hover-effect], ._hasGlowHover_1cx2pa_81)[data-extra-active-effect]{
102
+ --_rs-card-native-active-border-width:1px;
103
+ --_rs-card-native-active-border-color:rgba(
104
+ calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227),
105
+ 0.2
106
+ );
107
+ }
108
+
109
+ ._clickable_1cx2pa_120:is([data-extra-hover-effect], ._hasGlowHover_1cx2pa_81)._disableBorder_1cx2pa_77{
110
+ --_rs-card-native-hover-border-width:0px;
111
+ --_rs-card-native-hover-border-color:transparent;
112
+
113
+ --_rs-card-native-active-border-width:1px;
114
+ }
115
+
116
+ ._clickable_1cx2pa_120:is([data-extra-hover-effect], ._hasGlowHover_1cx2pa_81)._disableBorder_1cx2pa_77[data-extra-active-effect]{
117
+ --_rs-card-native-active-border-width:0px;
118
+ --_rs-card-native-active-border-color:transparent;
119
+ }
120
+
121
+ ._clickable_1cx2pa_120 {
122
+
123
+ --_rs-card-env-background:var(
124
+ --rs-card-static-background,
125
+ rgb(calc(255 - var(--_rs-theme-dark-coefficient, 0)*207), calc(255 - var(--_rs-theme-dark-coefficient, 0)*207), calc(255 - var(--_rs-theme-dark-coefficient, 0)*204))
126
+ );
127
+ --_rs-card-env-border-width:var(
128
+ --rs-card-static-border-width,
129
+ var(--_rs-card-native-base-border-width)
130
+ );
131
+ --_rs-card-env-border-color:var(
132
+ --rs-card-static-border-color,
133
+ rgba(calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227), 0.2)
134
+ );
135
+ --_rs-card-padding-final:var(--rs-card-padding, var(--_rs-card-padding));
136
+
137
+ position:relative;
138
+
139
+ display:block;
9
140
 
10
141
  overflow:hidden;
11
142
 
12
143
  box-sizing:border-box;
13
144
  min-height:0;
145
+ padding:var(--_rs-card-padding-final);
14
146
 
15
- border-width:1px;
16
- border-style:solid;
17
-
18
- border-color:var(--rs-card-border-color, transparent);
19
- border-radius:var(--rs-card-border-radius, 0);
147
+ border:none;
148
+ border-radius:var(--rs-card-border-radius, var(--_rs-card-border-radius));
20
149
 
21
150
  cursor:pointer;
22
151
  text-align:inherit;
23
152
 
24
- background-color:var(--rs-card-background-color, rgb(calc(255 - var(--_rs-theme-dark-coefficient, 0)*207), calc(255 - var(--_rs-theme-dark-coefficient, 0)*207), calc(255 - var(--_rs-theme-dark-coefficient, 0)*204)));
153
+ background:var(--_rs-card-env-background);
25
154
 
26
- transition:color 100ms, background-color 100ms, border-color 100ms;
155
+ transition:color 100ms, background-color 100ms;
27
156
  -webkit-appearance:none;
28
157
  -moz-appearance:none;
29
158
  appearance:none;
30
- -webkit-mask-image:-webkit-radial-gradient(white, black);
31
159
  }
32
- ._card_12rk3bb_6:focus-visible{
33
- outline:none;
160
+
161
+ ._clickable_1cx2pa_120::after{
162
+ position:absolute;
163
+ top:0;
164
+ right:0;
165
+ bottom:0;
166
+ left:0;
167
+
168
+ display:block;
169
+
170
+ border-radius:inherit;
171
+
172
+ content:'';
173
+ pointer-events:none;
174
+
175
+ box-shadow:inset 0 0 0 var(--_rs-card-env-border-width) var(--_rs-card-env-border-color);
176
+
177
+ transition:box-shadow 100ms;
34
178
  }
35
- a._card_12rk3bb_6{
36
- display:block;
37
179
 
38
- text-decoration:none;
39
- }
40
- a._card_12rk3bb_6:hover{
41
- text-decoration:none;
42
- }
43
- ._themeLight_12rk3bb_47{
44
- --rs-theme-dark:0;
45
- }
46
- ._themeDark_12rk3bb_52{
47
- --rs-theme-dark:1;
48
- }
49
- ._withStaticBorder_12rk3bb_56{
50
- border-color:var(--rs-card-border-color, rgba(calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227), .2));
51
- }
52
- ._cardPlain_12rk3bb_60._modeClassic_12rk3bb_60,
53
- ._cardPlain_12rk3bb_60._modeRock_12rk3bb_61{
54
- cursor:auto;
55
- }
56
- ._modeClassic_12rk3bb_60._withStatesBorder_12rk3bb_66:active{
57
- border-width:2px;
180
+ ._clickable_1cx2pa_120,
181
+ ._clickable_1cx2pa_120:hover{
182
+ text-decoration:none;
58
183
  }
59
- ._modeClassic_12rk3bb_60._withStatesBorder_12rk3bb_66:active._paddings16_12rk3bb_95{
60
- padding:15px;
184
+
185
+ @media (hover: hover){
186
+ ._clickable_1cx2pa_120:hover{
187
+ --rs-theme-flip:var(--_rs-card-states-theme-flip);
188
+
189
+ --_rs-card-env-background:var(
190
+ --rs-card-hover-background,
191
+ var(--_rs-card-hover-focus-background)
192
+ );
193
+ --_rs-card-env-border-width:var(
194
+ --rs-card-hover-border-width,
195
+ var(--_rs-card-native-hover-border-width)
196
+ );
197
+ --_rs-card-env-border-color:var(
198
+ --rs-card-hover-border-color,
199
+ var(--_rs-card-native-hover-border-color)
200
+ );
201
+ }
61
202
  }
62
- ._modeClassic_12rk3bb_60._withStatesBorder_12rk3bb_66:active._paddings24_12rk3bb_99{
63
- padding:23px;
203
+
204
+ ._clickable_1cx2pa_120:focus-visible{
205
+ --rs-theme-flip:var(--_rs-card-states-theme-flip);
206
+
207
+ --_rs-card-env-background:var(
208
+ --rs-card-focus-background,
209
+ var(--_rs-card-hover-focus-background)
210
+ );
211
+ --_rs-card-env-border-width:var(
212
+ --rs-card-focus-border-width,
213
+ var(--_rs-card-native-focus-border-width)
214
+ );
215
+ --_rs-card-env-border-color:var(
216
+ --rs-card-focus-border-color,
217
+ var(--_rs-card-native-focus-border-color)
218
+ );
219
+ outline:none;
64
220
  }
65
- ._modeClassic_12rk3bb_60._withStatesBorder_12rk3bb_66:active._paddings32_12rk3bb_103{
66
- padding:31px;
221
+
222
+ ._clickable_1cx2pa_120:active{
223
+ --rs-theme-flip:var(--_rs-card-states-theme-flip);
224
+
225
+ --_rs-card-env-background:var(
226
+ --rs-card-active-background,
227
+ var(--_rs-card-active-background)
228
+ );
229
+ --_rs-card-env-border-width:var(
230
+ --rs-card-active-border-width,
231
+ var(--_rs-card-native-active-border-width)
232
+ );
233
+ --_rs-card-env-border-color:var(
234
+ --rs-card-active-border-color,
235
+ var(--_rs-card-native-active-border-color)
236
+ );
67
237
  }
68
- ._modeClassic_12rk3bb_60._withStatesBorder_12rk3bb_66:not(._glowHover_12rk3bb_71):hover,
69
- ._modeClassic_12rk3bb_60._withStatesBorder_12rk3bb_66:not(._glowHover_12rk3bb_71):focus[data-focus-method='key'],
70
- ._modeClassic_12rk3bb_60._withStatesBorder_12rk3bb_66:not(._glowHover_12rk3bb_71):focus-visible,
71
- ._modeClassic_12rk3bb_60._withStatesBorder_12rk3bb_66:not(._glowHover_12rk3bb_71):active{
72
- --rs-card-border-color:rgb(calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227));
73
- }
74
- ._modeRock_12rk3bb_61:hover,
75
- ._modeRock_12rk3bb_61:focus[data-focus-method='key'],
76
- ._modeRock_12rk3bb_61:focus-visible{
77
- --rs-theme-flip:1;
78
- background-color:rgb(calc(255 - var(--_rs-theme-dark-coefficient, 0)*230), calc(255 - var(--_rs-theme-dark-coefficient, 0)*230), calc(255 - var(--_rs-theme-dark-coefficient, 0)*227));
238
+
239
+ ._tile_1cx2pa_241{
240
+ --_rs-theme-dark:var(
241
+ --_rs-internal-force-theme-dark-consult-rescui-before-using,
242
+ var(--rs-theme-dark, 0)
243
+ );
244
+ --_rs-theme-flip:var(--rs-theme-flip, 0);
245
+ --_rs-theme-dark-coefficient:calc(var(--_rs-theme-dark)*(1 - var(--_rs-theme-flip)) + var(--_rs-theme-flip)*(1 - var(--_rs-theme-dark)));
246
+ --_rs-theme-light-coefficient:calc(1 - var(--_rs-theme-dark-coefficient));
247
+
248
+ --_rs-card-padding-final:var(--rs-card-padding, var(--_rs-card-padding));
249
+
250
+ position:relative;
251
+
252
+ display:block;
253
+ overflow:hidden;
254
+
255
+ box-sizing:border-box;
256
+ min-height:0;
257
+ padding:var(--_rs-card-padding-final);
258
+
259
+ border:none;
260
+ border-radius:var(--rs-card-border-radius, var(--_rs-card-border-radius));
261
+
262
+ cursor:auto;
263
+ text-align:inherit;
264
+ text-decoration:none;
265
+
266
+ background:var(
267
+ --rs-card-static-background,
268
+ rgb(calc(255 - var(--_rs-theme-dark-coefficient, 0)*207), calc(255 - var(--_rs-theme-dark-coefficient, 0)*207), calc(255 - var(--_rs-theme-dark-coefficient, 0)*204))
269
+ );
270
+
271
+ -webkit-appearance:none;
272
+
273
+ -moz-appearance:none;
274
+
275
+ appearance:none;
276
+ }
277
+
278
+ ._tile_1cx2pa_241._disableBorder_1cx2pa_77{
279
+ box-shadow:none;
79
280
  }
80
- ._modeRock_12rk3bb_61:active{
81
- --rs-theme-flip:1;
82
- background-color:rgb(calc(244 - var(--_rs-theme-dark-coefficient, 0)*196), calc(244 - var(--_rs-theme-dark-coefficient, 0)*196), calc(244 - var(--_rs-theme-dark-coefficient, 0)*193));
281
+
282
+ ._tile_1cx2pa_241::after{
283
+ position:absolute;
284
+ top:0;
285
+ right:0;
286
+ bottom:0;
287
+ left:0;
288
+
289
+ display:block;
290
+
291
+ border-radius:inherit;
292
+
293
+ content:'';
294
+ pointer-events:none;
295
+
296
+ box-shadow:inset 0 0 0 var(--rs-card-static-border-width, 1px) var(
297
+ --rs-card-static-border-color,
298
+ rgba(calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227), 0.2)
299
+ );
83
300
  }
84
- ._paddings16_12rk3bb_95{
85
- padding:16px;
86
- }
87
- ._paddings24_12rk3bb_99{
88
- padding:24px;
89
- }
90
- ._paddings32_12rk3bb_103{
91
- padding:32px;
92
- }
93
- ._bordersRadius0_12rk3bb_107{
94
- --rs-card-border-radius:0;
95
- }
96
- ._bordersRadius8_12rk3bb_111{
97
- --rs-card-border-radius:8px;
98
- }
99
- ._bordersRadius16_12rk3bb_115{
100
- --rs-card-border-radius:16px;
301
+
302
+ ._fixedImageHeight_1cx2pa_295{
303
+ height:calc(188px + var(--_rs-card-padding-final));
304
+ max-height:calc(188px + var(--_rs-card-padding-final));
101
305
  }
102
- ._bordersRadius24_12rk3bb_119{
103
- --rs-card-border-radius:24px;
306
+
307
+ ._fixedImageHeight_1cx2pa_295 img{
308
+ height:100%;
309
+ }
310
+
311
+ ._fullImageWidth_1cx2pa_304 img{
312
+ width:100%;
104
313
  }
105
- ._cardImage_12rk3bb_123{
314
+
315
+ ._cardImage_1cx2pa_308{
106
316
  position:relative;
107
317
 
108
318
  overflow:hidden;
109
319
 
110
320
  box-sizing:border-box;
111
321
  }
112
- ._cardImageImg_12rk3bb_131{
322
+
323
+ ._cardImageImg_1cx2pa_316{
324
+ top:calc(var(--_rs-card-padding-final)*-1);
325
+ left:calc(var(--_rs-card-padding-final)*-1);
326
+
113
327
  display:flex;
114
328
  justify-content:center;
115
329
  align-items:center;
330
+
331
+ width:calc(100% + var(--_rs-card-padding-final)*2);
116
332
  }
117
- ._paddings16_12rk3bb_95 ._cardImageImg_12rk3bb_131{
118
- top:-16px;
119
- left:-16px;
120
- width:calc(100% + 32px);
121
- }
122
- ._paddings24_12rk3bb_99 ._cardImageImg_12rk3bb_131{
123
- top:-24px;
124
- left:-24px;
125
- width:calc(100% + 48px);
126
- }
127
- ._paddings32_12rk3bb_103 ._cardImageImg_12rk3bb_131{
128
- top:-32px;
129
- left:-32px;
130
- width:calc(100% + 64px);
131
- }
132
- ._cardImageImg_12rk3bb_131 img{
333
+
334
+ ._cardImageImg_1cx2pa_316 img{
133
335
  max-width:100%;
134
336
  max-height:100%;
135
-
136
- transition:transform .2s;
137
- transform:scale(1);
138
- }
139
- ._card_12rk3bb_6:hover ._cardImageImg_12rk3bb_131 img{
140
- transform:scale(1.1);
141
- }
142
- ._card_12rk3bb_6._cardPlain_12rk3bb_60:hover ._cardImageImg_12rk3bb_131 img{
143
- transform:none;
144
337
  }
145
- ._cardImageDiv_12rk3bb_165{
338
+
339
+ ._clickable_1cx2pa_120 ._cardImageImg_1cx2pa_316 img{
340
+ transition:transform 0.2s;
341
+ transform:scale(1);
342
+ }
343
+
344
+ ._clickable_1cx2pa_120:hover ._cardImageImg_1cx2pa_316 img{
345
+ transform:scale(1.1);
346
+ }
347
+
348
+ ._cardImageDiv_1cx2pa_341{
349
+ top:calc(var(--_rs-card-padding-final)*-1);
350
+ left:calc(var(--_rs-card-padding-final)*-1);
351
+
146
352
  display:flex;
147
353
  flex-direction:column;
148
354
  justify-content:flex-end;
149
355
 
356
+ width:calc(100% + var(--_rs-card-padding-final)*2);
357
+ padding:var(--_rs-card-padding-final);
150
358
 
151
359
  background-color:transparent;
152
360
  background-repeat:no-repeat;
153
361
  background-position:center;
154
362
  background-size:100% 100%;
155
-
156
- transition:background-size .2s;
157
363
  }
158
- ._paddings16_12rk3bb_95 ._cardImageDiv_12rk3bb_165{
159
- top:-16px;
160
- left:-16px;
161
- padding:16px;
162
- width:calc(100% + 32px);
163
- }
164
- ._card_12rk3bb_6:active ._paddings16_12rk3bb_95 ._cardImageDiv_12rk3bb_165{
165
- padding:calc(16px - 1);
166
- }
167
- ._paddings24_12rk3bb_99 ._cardImageDiv_12rk3bb_165{
168
- top:-24px;
169
- left:-24px;
170
- padding:24px;
171
- width:calc(100% + 48px);
172
- }
173
- ._card_12rk3bb_6:active ._paddings24_12rk3bb_99 ._cardImageDiv_12rk3bb_165{
174
- padding:calc(24px - 1);
175
- }
176
- ._paddings32_12rk3bb_103 ._cardImageDiv_12rk3bb_165{
177
- top:-32px;
178
- left:-32px;
179
- padding:32px;
180
- width:calc(100% + 64px);
181
- }
182
- ._card_12rk3bb_6:active ._paddings32_12rk3bb_103 ._cardImageDiv_12rk3bb_165{
183
- padding:calc(32px - 1);
364
+
365
+ ._clickable_1cx2pa_120 ._cardImageDiv_1cx2pa_341{
366
+ transition:background-size 0.2s;
184
367
  }
185
- ._card_12rk3bb_6:hover ._cardImageDiv_12rk3bb_165{
368
+
369
+ ._clickable_1cx2pa_120:hover ._cardImageDiv_1cx2pa_341{
186
370
  background-size:110% 110%;
187
371
  }
188
- ._card_12rk3bb_6._cardPlain_12rk3bb_60:hover ._cardImageDiv_12rk3bb_165{
189
- background-size:100% 100%;
190
- }
191
- ._fixedImageHeight_12rk3bb_200 img{
192
- height:100%;
193
- }
194
- ._paddings16_12rk3bb_95 ._fixedImageHeight_12rk3bb_200{
195
- height:204px;
196
- max-height:204px;
372
+
373
+ @media (hover: hover){
374
+ ._clickable_1cx2pa_120:hover ._innerLink_1cx2pa_366{
375
+ --_rs-typography-link-padding-bottom-from-state-hover:calc(1px - var(--_rs-typography-link-hover-underline-width-difference-wf));
376
+ --_rs-typography-link-border-bottom-width-from-state-hover:calc(var(--_rs-typography-link-border-bottom-width-wf) + var(--_rs-typography-link-hover-underline-width-difference-wf));
377
+ --_rs-typography-link-border-bottom-color-from-state-hover:var(
378
+ --_rs-typography-link-hover-underline-color-wf
379
+ );
380
+ --_rs-typography-link-border-image-from-state-hover:var(
381
+ --_rs-typography-link-hover-border-image-wf
382
+ );
383
+ --_rs-typography-link-color-from-state-hover:var(
384
+ --_rs-typography-link-hover-color-wf
385
+ );
386
+ --_rs-typography-link-background-size-from-state-hover:auto calc(100% + 4px);
387
+ --_rs-typography-link-after-margin-right-from-state-hover:var(
388
+ --_rs-typography-link-hover-after-offset-right-wf
389
+ );
390
+ --_rs-typography-link-after-margin-left-from-state-hover:var(
391
+ --_rs-typography-link-hover-after-offset-left-wf
392
+ );
393
+ }
197
394
  }
198
- ._paddings24_12rk3bb_99 ._fixedImageHeight_12rk3bb_200{
199
- height:212px;
200
- max-height:212px;
395
+
396
+ ._clickable_1cx2pa_120:focus-visible ._innerLink_1cx2pa_366{
397
+ --_rs-typography-link-box-shadow-from-state-focus-visible:var(
398
+ --_rs-color-primary
399
+ ) 0 0 0 4px;
201
400
  }
202
- ._paddings32_12rk3bb_103 ._fixedImageHeight_12rk3bb_200{
203
- height:220px;
204
- max-height:220px;
401
+
402
+ @media (hover: hover){
403
+ ._clickable_1cx2pa_120:hover ._innerButton_1cx2pa_378{
404
+ --_rs-button-border-inner-color:rgba(
405
+ calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227),
406
+ calc(0.3 + var(--_rs-theme-dark-coefficient, 0)*0.1)
407
+ );
408
+ --_rs-button-background-from-state-hover:var(--_rs-button-hover-background);
409
+ }
205
410
  }
206
- ._fullImageWidth_12rk3bb_218 img{
207
- width:100%;
208
- }
209
411
 
412
+ ._clickable_1cx2pa_120:active ._innerButton_1cx2pa_378{
413
+ --_rs-button-border-inner-width:2px;
414
+ --_rs-button-border-inner-color:rgb(calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227));
415
+ --_rs-button-background-from-state-active:var(
416
+ --_rs-button-active-background
417
+ );
418
+ }
210
419
 
420
+ ._clickable_1cx2pa_120:focus-visible ._innerButton_1cx2pa_378{
421
+ --_rs-button-box-shadow-from-state-focus-visible:var(
422
+ --_rs-color-primary-t-dim
423
+ ) 0 0 0 4px;
424
+ }
211
425
 
426
+ ._clickable_1cx2pa_120:active:focus-visible:not(:hover) ._innerButton_1cx2pa_378{
427
+ --_rs-button-background-from-state-active-focus-visible-no-hover:var(
428
+ --_rs-button-active-focus-visible-no-hover-background
429
+ );
430
+ }
package/lib/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { cardCn, cardImageCn, useCardCn } from './card';
1
+ export { cardCn, cardImageCn, useCardCn, cardButtonCn, cardLinkCn } from './card';
2
2
  export type { CardProps, CardImgType } from './card';
package/lib/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  import './index.css';
2
- export { cardCn, cardImageCn, useCardCn } from './card.js';
2
+ export { cardButtonCn, cardCn, cardImageCn, cardLinkCn, useCardCn } from './card.js';
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@rescui/card",
3
- "version": "0.10.11",
3
+ "version": "0.10.12-RUI-226-Update-card-cn-6e43cc89.60+6e43cc89",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
+ "module": "lib/index.js",
6
7
  "src:main": "src/index.ts",
7
8
  "files": [
8
9
  "lib",
@@ -22,15 +23,16 @@
22
23
  },
23
24
  "devDependencies": {
24
25
  "@jetbrains/logos": "^1.4.16",
25
- "@rescui/colors": "^0.2.6",
26
- "@rescui/postcss-preset-library": "^0.2.2",
27
- "@rescui/scripts": "^0.3.5",
28
- "@rescui/typography": "^0.19.1",
29
- "@rescui/visual-regression": "^0.1.2"
26
+ "@rescui/button": "0.19.2-RUI-226-Update-card-cn-6e43cc89.43+6e43cc89",
27
+ "@rescui/colors": "0.2.7-RUI-226-Update-card-cn-6e43cc89.60+6e43cc89",
28
+ "@rescui/postcss-preset-library": "0.2.2",
29
+ "@rescui/scripts": "0.4.0",
30
+ "@rescui/typography": "0.19.2-RUI-226-Update-card-cn-6e43cc89.60+6e43cc89",
31
+ "@rescui/visual-regression": "0.1.2"
30
32
  },
31
33
  "scripts": {
32
34
  "build": "rescui-scripts build"
33
35
  },
34
36
  "nx": {},
35
- "gitHead": "67627f69be3de4b4c6a21244fd7de36e841f01f0"
37
+ "gitHead": "6e43cc893fafb22b990273901bc0a070fb15761f"
36
38
  }