@rescui/card 0.10.11 → 0.10.12-RUI-226-Update-card-cn-baacc2f1.68

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,67 @@
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;
43
+ /** Make borders of solid color. This prop is useful when using `cardImageCn` helper so the border wouldn't mix with the image.
44
+ *
45
+ * @default false
46
+ * */
47
+ disableBorderTransparency?: boolean;
37
48
  };
38
49
  export declare type CardImgType = {
39
- /**
50
+ /** Sets a type of image in a card
40
51
  * @default cardImageDiv
41
52
  * */
42
53
  cardImageType?: CardImageType;
43
- /** Disable predefined image height, if you use this prop you should manually equalize image heights between cards on one row/group
54
+ /** Disable predefined image height, when using this prop manually equalize image heights within cards in one row or group
44
55
  * @default false
45
56
  * */
46
57
  disableFixedHeight?: boolean;
47
- /** Disable image stretching to the card width. Applied only to the `cardImageImg` card image type.
58
+ /** Disable stretching the image to the card width, only applies to the `cardImageImg` card image type
48
59
  * @default false
49
60
  * */
50
61
  disableFullWidth?: boolean;
51
62
  };
52
- export declare const cardCn: ({ isClickable, theme, mode, paddings, borderRadius, hasGlowHover, disableBorder }?: CardProps) => string;
63
+ export declare const cardLinkCn: () => any;
64
+ export declare const cardButtonCn: () => any;
65
+ export declare const cardCn: ({ isClickable, theme, mode, padding, borderRadius, disableBorder, disableBorderTransparency, paddings, hasGlowHover }?: CardProps) => string;
53
66
  export declare const cardImageCn: ({ cardImageType, disableFixedHeight, disableFullWidth }: CardImgType) => string;
54
67
  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,18 @@ 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
+ disableBorderTransparency,
43
+ paddings,
44
+ hasGlowHover
37
45
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
38
46
  const themeClass = THEME_STYLES[theme] ?? '';
39
47
  const modeClass = MODE_STYLES[mode] ?? MODE_STYLES.classic;
40
- const paddingsClass = PADDINGS_STYLES[paddings] ?? PADDINGS_STYLES[24];
48
+ const paddingClass = PADDING_STYLES[padding ?? paddings] ?? PADDING_STYLES[24];
41
49
  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
- });
50
+ return cn(isClickable ? styles.clickable : styles.tile, themeClass, isClickable ? modeClass : MODE_STYLES.classic, paddingClass, borderRadiusClass, hasGlowHover && styles.hasGlowHover, disableBorder && styles.disableBorder, disableBorderTransparency ? styles.transparentBorderFalse : styles.transparentBorderTrue);
49
51
  };
50
52
 
51
53
  const cardImageCn = _ref => {
@@ -66,4 +68,4 @@ const useCardCn = () => {
66
68
  });
67
69
  };
68
70
 
69
- export { cardCn, cardImageCn, useCardCn };
71
+ export { cardButtonCn, cardCn, cardImageCn, cardLinkCn, useCardCn };
@@ -1,24 +1,28 @@
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_bi1b6m_8",
3
+ "themeDark": "_themeDark_bi1b6m_11",
4
+ "padding0": "_padding0_bi1b6m_15",
5
+ "padding16": "_padding16_bi1b6m_18",
6
+ "padding24": "_padding24_bi1b6m_21",
7
+ "padding32": "_padding32_bi1b6m_24",
8
+ "borderRadius0": "_borderRadius0_bi1b6m_28",
9
+ "borderRadius8": "_borderRadius8_bi1b6m_31",
10
+ "borderRadius16": "_borderRadius16_bi1b6m_34",
11
+ "borderRadius24": "_borderRadius24_bi1b6m_37",
12
+ "modeClassic": "_modeClassic_bi1b6m_41",
13
+ "modeRock": "_modeRock_bi1b6m_50",
14
+ "transparentBorderTrue": "_transparentBorderTrue_bi1b6m_60",
15
+ "transparentBorderFalse": "_transparentBorderFalse_bi1b6m_63",
16
+ "clickable": "_clickable_bi1b6m_121",
17
+ "disableBorder": "_disableBorder_bi1b6m_84",
18
+ "hasGlowHover": "_hasGlowHover_bi1b6m_88",
19
+ "tile": "_tile_bi1b6m_253",
20
+ "fixedImageHeight": "_fixedImageHeight_bi1b6m_321",
21
+ "fullImageWidth": "_fullImageWidth_bi1b6m_330",
22
+ "cardImage": "_cardImage_bi1b6m_334",
23
+ "cardImageImg": "_cardImageImg_bi1b6m_342",
24
+ "cardImageDiv": "_cardImageDiv_bi1b6m_367",
25
+ "innerLink": "_innerLink_bi1b6m_392",
26
+ "innerButton": "_innerButton_bi1b6m_404"
23
27
  };
24
28
  export { styles as default };
package/lib/index.css CHANGED
@@ -1,4 +1,72 @@
1
- ._card_12rk3bb_6{
1
+ ._themeLight_bi1b6m_8{
2
+ --rs-theme-dark:0;
3
+ }
4
+
5
+ ._themeDark_bi1b6m_11{
6
+ --rs-theme-dark:1;
7
+ }
8
+
9
+ ._padding0_bi1b6m_15{
10
+ --_rs-card-padding:0px;
11
+ }
12
+
13
+ ._padding16_bi1b6m_18{
14
+ --_rs-card-padding:16px;
15
+ }
16
+
17
+ ._padding24_bi1b6m_21{
18
+ --_rs-card-padding:24px;
19
+ }
20
+
21
+ ._padding32_bi1b6m_24{
22
+ --_rs-card-padding:32px;
23
+ }
24
+
25
+ ._borderRadius0_bi1b6m_28{
26
+ --_rs-card-border-radius:0px;
27
+ }
28
+
29
+ ._borderRadius8_bi1b6m_31{
30
+ --_rs-card-border-radius:8px;
31
+ }
32
+
33
+ ._borderRadius16_bi1b6m_34{
34
+ --_rs-card-border-radius:16px;
35
+ }
36
+
37
+ ._borderRadius24_bi1b6m_37{
38
+ --_rs-card-border-radius:24px;
39
+ }
40
+
41
+ ._modeClassic_bi1b6m_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_bi1b6m_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
+ ._transparentBorderTrue_bi1b6m_60{
62
+ --_rs-card-grey-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), 0.2);
63
+ }
64
+
65
+ ._transparentBorderFalse_bi1b6m_63{
66
+ --_rs-card-grey-border-color:rgb(calc(209 - var(--_rs-theme-dark-coefficient, 0)*115), calc(209 - var(--_rs-theme-dark-coefficient, 0)*115), calc(210 - var(--_rs-theme-dark-coefficient, 0)*114));
67
+ }
68
+
69
+ ._clickable_bi1b6m_121{
2
70
  --_rs-theme-dark:var(
3
71
  --_rs-internal-force-theme-dark-consult-rescui-before-using,
4
72
  var(--rs-theme-dark, 0)
@@ -6,206 +74,380 @@
6
74
  --_rs-theme-flip:var(--rs-theme-flip, 0);
7
75
  --_rs-theme-dark-coefficient:calc(var(--_rs-theme-dark)*(1 - var(--_rs-theme-flip)) + var(--_rs-theme-flip)*(1 - var(--_rs-theme-dark)));
8
76
  --_rs-theme-light-coefficient:calc(1 - var(--_rs-theme-dark-coefficient));
77
+ --_rs-card-native-base-border-width:1px;
78
+ --_rs-card-native-hover-border-width:var(
79
+ --_rs-card-hover-focus-border-width
80
+ );
81
+ --_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));
82
+ --_rs-card-native-focus-border-width:var(
83
+ --_rs-card-hover-focus-border-width
84
+ );
85
+ --_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));
86
+ --_rs-card-native-active-border-width:var(--_rs-card-active-border-width);
87
+ --_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));
88
+ }
89
+
90
+ ._clickable_bi1b6m_121._disableBorder_bi1b6m_84{
91
+ --_rs-card-native-base-border-width:0px;
92
+ }
93
+
94
+ ._clickable_bi1b6m_121:is([data-extra-hover-effect], ._hasGlowHover_bi1b6m_88){
95
+ --_rs-card-native-hover-border-width:1px;
96
+ --_rs-card-native-hover-border-color:var(--_rs-card-grey-border-color);
97
+
98
+ --_rs-card-native-focus-border-width:1px;
99
+
100
+ --_rs-card-native-active-border-width:2px;
101
+ --_rs-card-native-active-border-color:rgb(
102
+ 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)
103
+ );
104
+ }
105
+
106
+ ._clickable_bi1b6m_121:is([data-extra-hover-effect], ._hasGlowHover_bi1b6m_88)[data-extra-active-effect]{
107
+ --_rs-card-native-active-border-width:1px;
108
+ --_rs-card-native-active-border-color:var(--_rs-card-grey-border-color);
109
+ }
110
+
111
+ ._clickable_bi1b6m_121:is([data-extra-hover-effect], ._hasGlowHover_bi1b6m_88)._disableBorder_bi1b6m_84{
112
+ --_rs-card-native-hover-border-width:0px;
113
+ --_rs-card-native-hover-border-color:transparent;
114
+
115
+ --_rs-card-native-active-border-width:1px;
116
+ }
117
+
118
+ ._clickable_bi1b6m_121:is([data-extra-hover-effect], ._hasGlowHover_bi1b6m_88)._disableBorder_bi1b6m_84[data-extra-active-effect]{
119
+ --_rs-card-native-active-border-width:0px;
120
+ --_rs-card-native-active-border-color:transparent;
121
+ }
122
+
123
+ ._clickable_bi1b6m_121 {
124
+
125
+ --_rs-card-env-background:var(
126
+ --rs-card-static-background,
127
+ 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))
128
+ );
129
+ --_rs-card-env-border-width:var(
130
+ --rs-card-static-border-width,
131
+ var(--_rs-card-native-base-border-width)
132
+ );
133
+ --_rs-card-env-border-color:var(
134
+ --rs-card-static-border-color,
135
+ var(--_rs-card-grey-border-color)
136
+ );
137
+ --_rs-card-padding-final:var(--rs-card-padding, var(--_rs-card-padding));
138
+ --_rs-card-border-radius-final:var(
139
+ --rs-card-border-radius,
140
+ var(--_rs-card-border-radius)
141
+ );
142
+ --rs-out-card-padding:var(--_rs-card-padding-final);
143
+ --rs-out-card-border-radius:var(--_rs-card-border-radius-final);
144
+ --rs-out-card-border-width:var(--_rs-card-env-border-width);
145
+ --rs-out-card-border-color:var(--_rs-card-env-border-color);
146
+ --rs-out-card-background:var(--_rs-card-env-background);
147
+
148
+ position:relative;
149
+
150
+ display:block;
9
151
 
10
152
  overflow:hidden;
11
153
 
12
154
  box-sizing:border-box;
13
155
  min-height:0;
156
+ padding:var(--_rs-card-padding-final);
14
157
 
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);
158
+ border:none;
159
+ border-radius:var(--_rs-card-border-radius-final);
20
160
 
21
161
  cursor:pointer;
22
162
  text-align:inherit;
23
163
 
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)));
164
+ background:var(--_rs-card-env-background);
25
165
 
26
- transition:color 100ms, background-color 100ms, border-color 100ms;
166
+ transition:color 100ms, background-color 100ms;
27
167
  -webkit-appearance:none;
28
168
  -moz-appearance:none;
29
169
  appearance:none;
30
- -webkit-mask-image:-webkit-radial-gradient(white, black);
31
170
  }
32
- ._card_12rk3bb_6:focus-visible{
33
- outline:none;
171
+
172
+ ._clickable_bi1b6m_121::after{
173
+ position:absolute;
174
+ top:0;
175
+ right:0;
176
+ bottom:0;
177
+ left:0;
178
+
179
+ display:block;
180
+
181
+ border-radius:inherit;
182
+
183
+ content:'';
184
+ pointer-events:none;
185
+
186
+ box-shadow:inset 0 0 0 var(--_rs-card-env-border-width) var(--_rs-card-env-border-color);
187
+
188
+ transition:box-shadow 100ms;
34
189
  }
35
- a._card_12rk3bb_6{
36
- display:block;
37
190
 
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;
191
+ ._clickable_bi1b6m_121,
192
+ ._clickable_bi1b6m_121:hover{
193
+ text-decoration:none;
58
194
  }
59
- ._modeClassic_12rk3bb_60._withStatesBorder_12rk3bb_66:active._paddings16_12rk3bb_95{
60
- padding:15px;
195
+
196
+ @media (hover: hover){
197
+ ._clickable_bi1b6m_121:hover{
198
+ --rs-theme-flip:var(--_rs-card-states-theme-flip);
199
+
200
+ --_rs-card-env-background:var(
201
+ --rs-card-hover-background,
202
+ var(--_rs-card-hover-focus-background)
203
+ );
204
+ --_rs-card-env-border-width:var(
205
+ --rs-card-hover-border-width,
206
+ var(--_rs-card-native-hover-border-width)
207
+ );
208
+ --_rs-card-env-border-color:var(
209
+ --rs-card-hover-border-color,
210
+ var(--_rs-card-native-hover-border-color)
211
+ );
212
+ }
61
213
  }
62
- ._modeClassic_12rk3bb_60._withStatesBorder_12rk3bb_66:active._paddings24_12rk3bb_99{
63
- padding:23px;
214
+
215
+ ._clickable_bi1b6m_121:focus-visible{
216
+ --rs-theme-flip:var(--_rs-card-states-theme-flip);
217
+
218
+ --_rs-card-env-background:var(
219
+ --rs-card-focus-background,
220
+ var(--_rs-card-hover-focus-background)
221
+ );
222
+ --_rs-card-env-border-width:var(
223
+ --rs-card-focus-border-width,
224
+ var(--_rs-card-native-focus-border-width)
225
+ );
226
+ --_rs-card-env-border-color:var(
227
+ --rs-card-focus-border-color,
228
+ var(--_rs-card-native-focus-border-color)
229
+ );
230
+ outline:none;
64
231
  }
65
- ._modeClassic_12rk3bb_60._withStatesBorder_12rk3bb_66:active._paddings32_12rk3bb_103{
66
- padding:31px;
232
+
233
+ ._clickable_bi1b6m_121:active{
234
+ --rs-theme-flip:var(--_rs-card-states-theme-flip);
235
+
236
+ --_rs-card-env-background:var(
237
+ --rs-card-active-background,
238
+ var(--_rs-card-active-background)
239
+ );
240
+ --_rs-card-env-border-width:var(
241
+ --rs-card-active-border-width,
242
+ var(--_rs-card-native-active-border-width)
243
+ );
244
+ --_rs-card-env-border-color:var(
245
+ --rs-card-active-border-color,
246
+ var(--_rs-card-native-active-border-color)
247
+ );
67
248
  }
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));
249
+
250
+ ._tile_bi1b6m_253{
251
+ --_rs-theme-dark:var(
252
+ --_rs-internal-force-theme-dark-consult-rescui-before-using,
253
+ var(--rs-theme-dark, 0)
254
+ );
255
+ --_rs-theme-flip:var(--rs-theme-flip, 0);
256
+ --_rs-theme-dark-coefficient:calc(var(--_rs-theme-dark)*(1 - var(--_rs-theme-flip)) + var(--_rs-theme-flip)*(1 - var(--_rs-theme-dark)));
257
+ --_rs-theme-light-coefficient:calc(1 - var(--_rs-theme-dark-coefficient));
258
+
259
+ --_rs-card-env-background:var(
260
+ --rs-card-static-background,
261
+ 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))
262
+ );
263
+ --_rs-card-env-border-width:var(--rs-card-static-border-width, 1px);
264
+ --_rs-card-env-border-color:var(
265
+ --rs-card-static-border-color,
266
+ var(--_rs-card-grey-border-color)
267
+ );
268
+ --_rs-card-padding-final:var(--rs-card-padding, var(--_rs-card-padding));
269
+ --_rs-card-border-radius-final:var(
270
+ --rs-card-border-radius,
271
+ var(--_rs-card-border-radius)
272
+ );
273
+ --rs-out-card-padding:var(--_rs-card-padding-final);
274
+ --rs-out-card-border-radius:var(--_rs-card-border-radius-final);
275
+ --rs-out-card-border-width:var(--_rs-card-env-border-width);
276
+ --rs-out-card-border-color:var(--_rs-card-env-border-color);
277
+ --rs-out-card-background:var(--_rs-card-env-background);
278
+
279
+ position:relative;
280
+
281
+ display:block;
282
+ overflow:hidden;
283
+
284
+ box-sizing:border-box;
285
+ min-height:0;
286
+ padding:var(--_rs-card-padding-final);
287
+
288
+ border:none;
289
+ border-radius:var(--_rs-card-border-radius-final);
290
+
291
+ cursor:auto;
292
+ text-align:inherit;
293
+ text-decoration:none;
294
+
295
+ background:var(--_rs-card-env-background);
296
+
297
+ -webkit-appearance:none;
298
+
299
+ -moz-appearance:none;
300
+
301
+ appearance:none;
302
+ }
303
+
304
+ ._tile_bi1b6m_253._disableBorder_bi1b6m_84{
305
+ box-shadow:none;
79
306
  }
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));
307
+
308
+ ._tile_bi1b6m_253::after{
309
+ position:absolute;
310
+ top:0;
311
+ right:0;
312
+ bottom:0;
313
+ left:0;
314
+
315
+ display:block;
316
+
317
+ border-radius:inherit;
318
+
319
+ content:'';
320
+ pointer-events:none;
321
+
322
+ box-shadow:inset 0 0 0 var(--_rs-card-env-border-width) var(--_rs-card-env-border-color);
83
323
  }
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;
324
+
325
+ ._fixedImageHeight_bi1b6m_321{
326
+ height:calc(188px + var(--_rs-card-padding-final));
327
+ max-height:calc(188px + var(--_rs-card-padding-final));
101
328
  }
102
- ._bordersRadius24_12rk3bb_119{
103
- --rs-card-border-radius:24px;
329
+
330
+ ._fixedImageHeight_bi1b6m_321 img{
331
+ height:100%;
332
+ }
333
+
334
+ ._fullImageWidth_bi1b6m_330 img{
335
+ width:100%;
104
336
  }
105
- ._cardImage_12rk3bb_123{
337
+
338
+ ._cardImage_bi1b6m_334{
106
339
  position:relative;
107
340
 
108
341
  overflow:hidden;
109
342
 
110
343
  box-sizing:border-box;
111
344
  }
112
- ._cardImageImg_12rk3bb_131{
345
+
346
+ ._cardImageImg_bi1b6m_342{
347
+ top:calc(var(--_rs-card-padding-final)*-1);
348
+ left:calc(var(--_rs-card-padding-final)*-1);
349
+
113
350
  display:flex;
114
351
  justify-content:center;
115
352
  align-items:center;
353
+
354
+ width:calc(100% + var(--_rs-card-padding-final)*2);
116
355
  }
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{
356
+
357
+ ._cardImageImg_bi1b6m_342 img{
133
358
  max-width:100%;
134
359
  max-height:100%;
135
-
136
- transition:transform .2s;
137
- transform:scale(1);
138
360
  }
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
- }
145
- ._cardImageDiv_12rk3bb_165{
361
+
362
+ ._clickable_bi1b6m_121 ._cardImageImg_bi1b6m_342 img{
363
+ transition:transform 0.2s;
364
+ transform:scale(1);
365
+ }
366
+
367
+ ._clickable_bi1b6m_121:hover ._cardImageImg_bi1b6m_342 img{
368
+ transform:scale(1.1);
369
+ }
370
+
371
+ ._cardImageDiv_bi1b6m_367{
372
+ top:calc(var(--_rs-card-padding-final)*-1);
373
+ left:calc(var(--_rs-card-padding-final)*-1);
374
+
146
375
  display:flex;
147
376
  flex-direction:column;
148
377
  justify-content:flex-end;
149
378
 
379
+ width:calc(100% + var(--_rs-card-padding-final)*2);
380
+ padding:var(--_rs-card-padding-final);
150
381
 
151
382
  background-color:transparent;
152
383
  background-repeat:no-repeat;
153
384
  background-position:center;
154
385
  background-size:100% 100%;
155
-
156
- transition:background-size .2s;
157
386
  }
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);
387
+
388
+ ._clickable_bi1b6m_121 ._cardImageDiv_bi1b6m_367{
389
+ transition:background-size 0.2s;
184
390
  }
185
- ._card_12rk3bb_6:hover ._cardImageDiv_12rk3bb_165{
391
+
392
+ ._clickable_bi1b6m_121:hover ._cardImageDiv_bi1b6m_367{
186
393
  background-size:110% 110%;
187
394
  }
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;
395
+
396
+ @media (hover: hover){
397
+ ._clickable_bi1b6m_121:hover ._innerLink_bi1b6m_392{
398
+ --_rs-typography-link-padding-bottom-from-state-hover:calc(1px - var(--_rs-typography-link-hover-underline-width-difference-wf));
399
+ --_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));
400
+ --_rs-typography-link-border-bottom-color-from-state-hover:var(
401
+ --_rs-typography-link-hover-underline-color-wf
402
+ );
403
+ --_rs-typography-link-border-image-from-state-hover:var(
404
+ --_rs-typography-link-hover-border-image-wf
405
+ );
406
+ --_rs-typography-link-color-from-state-hover:var(
407
+ --_rs-typography-link-hover-color-wf
408
+ );
409
+ --_rs-typography-link-background-size-from-state-hover:auto calc(100% + 4px);
410
+ --_rs-typography-link-after-margin-right-from-state-hover:var(
411
+ --_rs-typography-link-hover-after-offset-right-wf
412
+ );
413
+ --_rs-typography-link-after-margin-left-from-state-hover:var(
414
+ --_rs-typography-link-hover-after-offset-left-wf
415
+ );
416
+ }
197
417
  }
198
- ._paddings24_12rk3bb_99 ._fixedImageHeight_12rk3bb_200{
199
- height:212px;
200
- max-height:212px;
418
+
419
+ ._clickable_bi1b6m_121:focus-visible ._innerLink_bi1b6m_392{
420
+ --_rs-typography-link-box-shadow-from-state-focus-visible:var(
421
+ --_rs-color-primary
422
+ ) 0 0 0 4px;
201
423
  }
202
- ._paddings32_12rk3bb_103 ._fixedImageHeight_12rk3bb_200{
203
- height:220px;
204
- max-height:220px;
424
+
425
+ @media (hover: hover){
426
+ ._clickable_bi1b6m_121:hover ._innerButton_bi1b6m_404{
427
+ --_rs-button-border-inner-color:rgba(
428
+ 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),
429
+ calc(0.3 + var(--_rs-theme-dark-coefficient, 0)*0.1)
430
+ );
431
+ --_rs-button-background-from-state-hover:var(--_rs-button-hover-background);
432
+ }
205
433
  }
206
- ._fullImageWidth_12rk3bb_218 img{
207
- width:100%;
208
- }
209
434
 
435
+ ._clickable_bi1b6m_121:active ._innerButton_bi1b6m_404{
436
+ --_rs-button-border-inner-width:2px;
437
+ --_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));
438
+ --_rs-button-background-from-state-active:var(
439
+ --_rs-button-active-background
440
+ );
441
+ }
210
442
 
443
+ ._clickable_bi1b6m_121:focus-visible ._innerButton_bi1b6m_404{
444
+ --_rs-button-box-shadow-from-state-focus-visible:var(
445
+ --_rs-color-primary-t-dim
446
+ ) 0 0 0 4px;
447
+ }
211
448
 
449
+ ._clickable_bi1b6m_121:active:focus-visible:not(:hover) ._innerButton_bi1b6m_404{
450
+ --_rs-button-background-from-state-active-focus-visible-no-hover:var(
451
+ --_rs-button-active-focus-visible-no-hover-background
452
+ );
453
+ }
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-baacc2f1.68+baacc2f1",
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-baacc2f1.51+baacc2f1",
27
+ "@rescui/colors": "0.2.7-RUI-226-Update-card-cn-baacc2f1.68+baacc2f1",
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-baacc2f1.68+baacc2f1",
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": "baacc2f1a9fe296e6d64d62b8b3143d09cdb70fb"
36
38
  }