@canlooks/can-ui 0.0.98 → 0.0.99

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.
Files changed (199) hide show
  1. package/dist/cjs/components/accordion/accordion.style.js +88 -86
  2. package/dist/cjs/components/actionSheet/actionSheet.style.js +35 -33
  3. package/dist/cjs/components/alert/alert.style.js +44 -42
  4. package/dist/cjs/components/anchorList/anchorList.style.js +40 -38
  5. package/dist/cjs/components/app/app.style.js +24 -17
  6. package/dist/cjs/components/avatar/avatar.style.js +22 -20
  7. package/dist/cjs/components/avatar/avatarGroup.style.js +24 -22
  8. package/dist/cjs/components/backdrop/backdrop.style.js +11 -9
  9. package/dist/cjs/components/badge/badge.style.js +42 -40
  10. package/dist/cjs/components/bottomNavigation/bottomNavigation.style.js +61 -59
  11. package/dist/cjs/components/boundary/errorBoundary.style.js +11 -9
  12. package/dist/cjs/components/breadcrumb/breadcrumb.style.js +8 -6
  13. package/dist/cjs/components/bubble/bubble.style.js +10 -8
  14. package/dist/cjs/components/bubbleConfirm/bubbleConfirm.style.js +37 -35
  15. package/dist/cjs/components/button/button.style.js +219 -197
  16. package/dist/cjs/components/calendar/calendar.style.js +93 -91
  17. package/dist/cjs/components/card/card.style.js +47 -44
  18. package/dist/cjs/components/cascade/cascade.style.js +58 -54
  19. package/dist/cjs/components/checkboxBase/checkboxBase.style.js +122 -120
  20. package/dist/cjs/components/colorPicker/colorPicker.style.js +68 -64
  21. package/dist/cjs/components/counter/counter.style.js +19 -17
  22. package/dist/cjs/components/curd/curd.style.js +70 -66
  23. package/dist/cjs/components/curd/curdColumnConfig.style.js +17 -15
  24. package/dist/cjs/components/dataGrid/dataGrid.style.js +113 -111
  25. package/dist/cjs/components/dateTimePicker/dateTimePicker.style.js +31 -27
  26. package/dist/cjs/components/dateTimePicker/timer.style.js +29 -27
  27. package/dist/cjs/components/dateTimeRangePicker/dateTimeRangePicker.style.js +7 -5
  28. package/dist/cjs/components/descriptions/descriptions.style.js +99 -95
  29. package/dist/cjs/components/dialog/dialog.style.js +98 -96
  30. package/dist/cjs/components/divider/divider.style.js +17 -15
  31. package/dist/cjs/components/drawer/drawer.style.js +78 -77
  32. package/dist/cjs/components/dropdown/dropdown.style.js +10 -8
  33. package/dist/cjs/components/flex/flex.js +10 -5
  34. package/dist/cjs/components/flex/flex.style.d.ts +1 -0
  35. package/dist/cjs/components/flex/flex.style.js +17 -1
  36. package/dist/cjs/components/form/form.style.js +27 -25
  37. package/dist/cjs/components/gallery/gallery.style.js +82 -80
  38. package/dist/cjs/components/image/image.style.js +35 -33
  39. package/dist/cjs/components/input/input.style.js +27 -26
  40. package/dist/cjs/components/inputBase/inputBase.style.js +164 -162
  41. package/dist/cjs/components/loading/loading.style.js +17 -15
  42. package/dist/cjs/components/loadingIndicator/loadingIndicator.style.js +10 -8
  43. package/dist/cjs/components/loadingMask/loadingMask.style.js +19 -17
  44. package/dist/cjs/components/menu/menu.style.js +3 -1
  45. package/dist/cjs/components/menuItem/menuItem.style.js +94 -90
  46. package/dist/cjs/components/modal/modal.style.js +11 -9
  47. package/dist/cjs/components/optionsBase/optionsBase.style.js +10 -8
  48. package/dist/cjs/components/overlayBase/overlayBase.style.js +15 -13
  49. package/dist/cjs/components/pagination/pagination.style.js +31 -29
  50. package/dist/cjs/components/palette/palette.style.d.ts +1 -1
  51. package/dist/cjs/components/palette/palette.style.js +115 -113
  52. package/dist/cjs/components/pickerDialog/pickerDialog.style.js +25 -23
  53. package/dist/cjs/components/pinchable/pinchable.style.js +10 -8
  54. package/dist/cjs/components/placeholder/placeholder.style.js +28 -26
  55. package/dist/cjs/components/popper/popper.style.js +43 -39
  56. package/dist/cjs/components/progress/progress.style.js +111 -111
  57. package/dist/cjs/components/rating/rating.style.js +52 -50
  58. package/dist/cjs/components/resizable/resizable.style.js +229 -223
  59. package/dist/cjs/components/scrollbar/scrollbar.style.js +71 -69
  60. package/dist/cjs/components/segmented/segmented.style.js +79 -77
  61. package/dist/cjs/components/select/select.style.js +36 -34
  62. package/dist/cjs/components/selectedList/selectedList.style.js +9 -7
  63. package/dist/cjs/components/serialInput/serialInput.style.js +4 -2
  64. package/dist/cjs/components/skeleton/skeleton.style.js +53 -47
  65. package/dist/cjs/components/slidableActions/slidableActions.style.js +45 -43
  66. package/dist/cjs/components/slider/slider.style.js +129 -127
  67. package/dist/cjs/components/snackbarBase/snackbarBase.style.js +96 -94
  68. package/dist/cjs/components/status/status.style.js +13 -11
  69. package/dist/cjs/components/stepper/step.style.js +217 -216
  70. package/dist/cjs/components/stepper/stepper.style.js +5 -3
  71. package/dist/cjs/components/switch/switch.style.js +73 -71
  72. package/dist/cjs/components/table/table.style.js +83 -81
  73. package/dist/cjs/components/table/tableSticky.style.js +33 -31
  74. package/dist/cjs/components/tabs/tabs.style.js +161 -159
  75. package/dist/cjs/components/tabs/tabsEllipsis.style.js +5 -3
  76. package/dist/cjs/components/tag/tag.style.js +96 -94
  77. package/dist/cjs/components/textarea/textarea.style.js +27 -25
  78. package/dist/cjs/components/theme/themeVariables.d.ts +1 -0
  79. package/dist/cjs/components/theme/themeVariables.js +3 -1
  80. package/dist/cjs/components/timeline/timeline.style.js +112 -108
  81. package/dist/cjs/components/toggleButton/toggleButton.style.js +7 -5
  82. package/dist/cjs/components/tooltip/tooltip.style.js +13 -11
  83. package/dist/cjs/components/touchRipple/touchRipple.style.js +19 -17
  84. package/dist/cjs/components/transfer/transfer.style.js +42 -40
  85. package/dist/cjs/components/transitionBase/transitionBase.style.js +101 -94
  86. package/dist/cjs/components/transportStyle/transportStyle.d.ts +1 -0
  87. package/dist/cjs/components/transportStyle/transportStyle.js +33 -7
  88. package/dist/cjs/components/transportStyle/transportStyle.style.d.ts +1 -0
  89. package/dist/cjs/components/transportStyle/transportStyle.style.js +57 -0
  90. package/dist/cjs/components/tree/tree.style.js +83 -79
  91. package/dist/cjs/components/tree/treeDnd.style.js +131 -129
  92. package/dist/cjs/components/treeSelect/treeSelect.style.js +35 -33
  93. package/dist/cjs/components/typography/typography.style.js +98 -96
  94. package/dist/cjs/components/upload/dropArea.style.js +31 -29
  95. package/dist/cjs/components/upload/upload.style.js +106 -104
  96. package/dist/cjs/components/waterfall/waterfall.style.js +7 -5
  97. package/dist/cjs/extensions/documentViewer/documentViewer.style.js +43 -41
  98. package/dist/cjs/utils/utils.d.ts +0 -6
  99. package/dist/cjs/utils/utils.js +0 -14
  100. package/dist/esm/components/accordion/accordion.style.js +88 -86
  101. package/dist/esm/components/actionSheet/actionSheet.style.js +35 -33
  102. package/dist/esm/components/alert/alert.style.js +44 -42
  103. package/dist/esm/components/anchorList/anchorList.style.js +40 -38
  104. package/dist/esm/components/app/app.style.js +24 -17
  105. package/dist/esm/components/avatar/avatar.style.js +22 -20
  106. package/dist/esm/components/avatar/avatarGroup.style.js +24 -22
  107. package/dist/esm/components/backdrop/backdrop.style.js +11 -9
  108. package/dist/esm/components/badge/badge.style.js +42 -40
  109. package/dist/esm/components/bottomNavigation/bottomNavigation.style.js +61 -59
  110. package/dist/esm/components/boundary/errorBoundary.style.js +11 -9
  111. package/dist/esm/components/breadcrumb/breadcrumb.style.js +8 -6
  112. package/dist/esm/components/bubble/bubble.style.js +10 -8
  113. package/dist/esm/components/bubbleConfirm/bubbleConfirm.style.js +37 -35
  114. package/dist/esm/components/button/button.style.js +219 -197
  115. package/dist/esm/components/calendar/calendar.style.js +93 -91
  116. package/dist/esm/components/card/card.style.js +58 -55
  117. package/dist/esm/components/cascade/cascade.style.js +58 -54
  118. package/dist/esm/components/checkboxBase/checkboxBase.style.js +122 -120
  119. package/dist/esm/components/colorPicker/colorPicker.style.js +69 -65
  120. package/dist/esm/components/counter/counter.style.js +19 -17
  121. package/dist/esm/components/curd/curd.style.js +70 -66
  122. package/dist/esm/components/curd/curdColumnConfig.style.js +17 -15
  123. package/dist/esm/components/dataGrid/dataGrid.style.js +113 -111
  124. package/dist/esm/components/dateTimePicker/dateTimePicker.style.js +31 -27
  125. package/dist/esm/components/dateTimePicker/timer.style.js +29 -27
  126. package/dist/esm/components/dateTimeRangePicker/dateTimeRangePicker.style.js +7 -5
  127. package/dist/esm/components/descriptions/descriptions.style.js +99 -95
  128. package/dist/esm/components/dialog/dialog.style.js +98 -96
  129. package/dist/esm/components/divider/divider.style.js +17 -15
  130. package/dist/esm/components/drawer/drawer.style.js +78 -77
  131. package/dist/esm/components/dropdown/dropdown.style.js +10 -8
  132. package/dist/esm/components/flex/flex.js +13 -8
  133. package/dist/esm/components/flex/flex.style.d.ts +1 -0
  134. package/dist/esm/components/flex/flex.style.js +16 -0
  135. package/dist/esm/components/form/form.style.js +27 -25
  136. package/dist/esm/components/gallery/gallery.style.js +82 -80
  137. package/dist/esm/components/image/image.style.js +35 -33
  138. package/dist/esm/components/input/input.style.js +27 -26
  139. package/dist/esm/components/inputBase/inputBase.style.js +164 -162
  140. package/dist/esm/components/loading/loading.style.js +17 -15
  141. package/dist/esm/components/loadingIndicator/loadingIndicator.style.js +10 -8
  142. package/dist/esm/components/loadingMask/loadingMask.style.js +19 -17
  143. package/dist/esm/components/menu/menu.style.js +3 -1
  144. package/dist/esm/components/menuItem/menuItem.style.js +94 -90
  145. package/dist/esm/components/modal/modal.style.js +11 -9
  146. package/dist/esm/components/optionsBase/optionsBase.style.js +10 -8
  147. package/dist/esm/components/overlayBase/overlayBase.style.js +15 -13
  148. package/dist/esm/components/pagination/pagination.style.js +31 -29
  149. package/dist/esm/components/palette/palette.style.d.ts +1 -1
  150. package/dist/esm/components/palette/palette.style.js +113 -111
  151. package/dist/esm/components/pickerDialog/pickerDialog.style.js +25 -23
  152. package/dist/esm/components/pinchable/pinchable.style.js +10 -8
  153. package/dist/esm/components/placeholder/placeholder.style.js +28 -26
  154. package/dist/esm/components/popper/popper.style.js +43 -39
  155. package/dist/esm/components/progress/progress.style.js +111 -111
  156. package/dist/esm/components/rating/rating.style.js +52 -50
  157. package/dist/esm/components/resizable/resizable.style.js +229 -223
  158. package/dist/esm/components/scrollbar/scrollbar.style.js +71 -69
  159. package/dist/esm/components/segmented/segmented.style.js +79 -77
  160. package/dist/esm/components/select/select.style.js +36 -34
  161. package/dist/esm/components/selectedList/selectedList.style.js +9 -7
  162. package/dist/esm/components/serialInput/serialInput.style.js +4 -2
  163. package/dist/esm/components/skeleton/skeleton.style.js +53 -47
  164. package/dist/esm/components/slidableActions/slidableActions.style.js +45 -43
  165. package/dist/esm/components/slider/slider.style.js +129 -127
  166. package/dist/esm/components/snackbarBase/snackbarBase.style.js +96 -94
  167. package/dist/esm/components/status/status.style.js +13 -11
  168. package/dist/esm/components/stepper/step.style.js +217 -216
  169. package/dist/esm/components/stepper/stepper.style.js +5 -3
  170. package/dist/esm/components/switch/switch.style.js +73 -71
  171. package/dist/esm/components/table/table.style.js +83 -81
  172. package/dist/esm/components/table/tableSticky.style.js +33 -31
  173. package/dist/esm/components/tabs/tabs.style.js +161 -159
  174. package/dist/esm/components/tabs/tabsEllipsis.style.js +5 -3
  175. package/dist/esm/components/tag/tag.style.js +96 -94
  176. package/dist/esm/components/textarea/textarea.style.js +27 -25
  177. package/dist/esm/components/theme/themeVariables.d.ts +1 -0
  178. package/dist/esm/components/theme/themeVariables.js +2 -0
  179. package/dist/esm/components/timeline/timeline.style.js +112 -108
  180. package/dist/esm/components/toggleButton/toggleButton.style.js +7 -5
  181. package/dist/esm/components/tooltip/tooltip.style.js +13 -11
  182. package/dist/esm/components/touchRipple/touchRipple.style.js +19 -17
  183. package/dist/esm/components/transfer/transfer.style.js +42 -40
  184. package/dist/esm/components/transitionBase/transitionBase.style.js +101 -94
  185. package/dist/esm/components/transportStyle/transportStyle.d.ts +1 -0
  186. package/dist/esm/components/transportStyle/transportStyle.js +33 -8
  187. package/dist/esm/components/transportStyle/transportStyle.style.d.ts +1 -0
  188. package/dist/esm/components/transportStyle/transportStyle.style.js +54 -0
  189. package/dist/esm/components/tree/tree.style.js +83 -79
  190. package/dist/esm/components/tree/treeDnd.style.js +131 -129
  191. package/dist/esm/components/treeSelect/treeSelect.style.js +35 -33
  192. package/dist/esm/components/typography/typography.style.js +98 -96
  193. package/dist/esm/components/upload/dropArea.style.js +31 -29
  194. package/dist/esm/components/upload/upload.style.js +106 -104
  195. package/dist/esm/components/waterfall/waterfall.style.js +7 -5
  196. package/dist/esm/extensions/documentViewer/documentViewer.style.js +43 -41
  197. package/dist/esm/utils/utils.d.ts +0 -6
  198. package/dist/esm/utils/utils.js +0 -13
  199. package/package.json +1 -1
@@ -9,121 +9,123 @@ export const classes = defineInnerClasses('accordion', [
9
9
  'content'
10
10
  ]);
11
11
  export const style = defineCss(({ divider, borderRadius, background, spacing, text, gray, easing }) => css `
12
- border: 1px solid ${divider};
13
- border-radius: ${borderRadius}px;
14
- background-color: ${background.content};
15
- transition: margin .25s ${easing.easeOut};
16
-
17
- .${classes.titleRow} {
18
- display: flex;
19
- align-items: center;
20
- gap: ${spacing[2]}px;
21
- padding: 9px ${spacing[5]}px;
22
- transition: padding .25s ${easing.easeOut};
23
-
24
- .${classes.expandIcon} {
25
- color: ${text.disabled};
26
- transition: transform .25s ${easing.easeOut};
27
- }
28
-
29
- .${classes.title} {
30
- flex: 1;
31
- white-space: nowrap;
32
- text-overflow: ellipsis;
33
- overflow: hidden;
34
- }
35
-
36
- .${classes.prefix},
37
- .${classes.suffix} {
38
- color: ${text.secondary};
39
- }
40
- }
12
+ @layer reset {
13
+ border: 1px solid ${divider};
14
+ border-radius: ${borderRadius}px;
15
+ background-color: ${background.content};
16
+ transition: margin .25s ${easing.easeOut};
41
17
 
42
- &:not([data-read-only=true]):not([data-disabled=true]) {
43
18
  .${classes.titleRow} {
44
- cursor: pointer;
45
- }
46
- }
47
-
48
- &[data-disabled=true] {
49
- background-color: ${gray(.1)};
19
+ display: flex;
20
+ align-items: center;
21
+ gap: ${spacing[2]}px;
22
+ padding: 9px ${spacing[5]}px;
23
+ transition: padding .25s ${easing.easeOut};
24
+
25
+ .${classes.expandIcon} {
26
+ color: ${text.disabled};
27
+ transition: transform .25s ${easing.easeOut};
28
+ }
50
29
 
51
- .${classes.titleRow} {
52
- cursor: not-allowed;
53
- }
54
- }
30
+ .${classes.title} {
31
+ flex: 1;
32
+ white-space: nowrap;
33
+ text-overflow: ellipsis;
34
+ overflow: hidden;
35
+ }
55
36
 
56
- &[data-expanded=true] {
57
- .${classes.titleRow} {
58
- padding: 15px ${spacing[5]}px;
37
+ .${classes.prefix},
38
+ .${classes.suffix} {
39
+ color: ${text.secondary};
40
+ }
59
41
  }
60
42
 
61
- .${classes.expandIcon} {
62
- transform: rotate(90deg);
43
+ &:not([data-read-only=true]):not([data-disabled=true]) {
44
+ .${classes.titleRow} {
45
+ cursor: pointer;
46
+ }
63
47
  }
64
- }
65
48
 
66
- .${classes.content} {
67
- padding: 0 ${spacing[5]}px ${spacing[5]}px;
68
- }
49
+ &[data-disabled=true] {
50
+ background-color: ${gray(.1)};
69
51
 
70
- &[data-size=small] {
71
- .${classes.titleRow} {
72
- padding: 6px ${spacing[5]}px;
52
+ .${classes.titleRow} {
53
+ cursor: not-allowed;
54
+ }
73
55
  }
74
56
 
75
57
  &[data-expanded=true] {
76
58
  .${classes.titleRow} {
77
- padding: 11px ${spacing[5]}px;
59
+ padding: 15px ${spacing[5]}px;
60
+ }
61
+
62
+ .${classes.expandIcon} {
63
+ transform: rotate(90deg);
78
64
  }
79
65
  }
80
- }
81
66
 
82
- &[data-size=large] {
83
- .${classes.titleRow} {
84
- padding: 12px ${spacing[5]}px;
67
+ .${classes.content} {
68
+ padding: 0 ${spacing[5]}px ${spacing[5]}px;
85
69
  }
86
70
 
87
- &[data-expanded=true] {
71
+ &[data-size=small] {
88
72
  .${classes.titleRow} {
89
- padding: 17px ${spacing[5]}px;
73
+ padding: 6px ${spacing[5]}px;
90
74
  }
91
- }
92
- }
93
75
 
94
- &[data-compact=column] {
95
- &:not([data-first=true]) {
96
- border-top-left-radius: 0;
97
- border-top-right-radius: 0;
98
- margin-top: -1px;
76
+ &[data-expanded=true] {
77
+ .${classes.titleRow} {
78
+ padding: 11px ${spacing[5]}px;
79
+ }
80
+ }
99
81
  }
100
-
101
- &:not([data-last=true]) {
102
- border-bottom-left-radius: 0;
103
- border-bottom-right-radius: 0;
82
+
83
+ &[data-size=large] {
84
+ .${classes.titleRow} {
85
+ padding: 12px ${spacing[5]}px;
86
+ }
87
+
88
+ &[data-expanded=true] {
89
+ .${classes.titleRow} {
90
+ padding: 17px ${spacing[5]}px;
91
+ }
92
+ }
104
93
  }
105
-
106
- &[data-expanded=true] {
94
+
95
+ &[data-compact=column] {
107
96
  &:not([data-first=true]) {
108
- margin-top: ${spacing[3]}px;
97
+ border-top-left-radius: 0;
98
+ border-top-right-radius: 0;
99
+ margin-top: -1px;
109
100
  }
110
101
 
111
- &:not([data-last=true]):not(:has(+ [data-expanded=true])) {
112
- margin-bottom: ${spacing[3]}px
102
+ &:not([data-last=true]) {
103
+ border-bottom-left-radius: 0;
104
+ border-bottom-right-radius: 0;
113
105
  }
114
- }
115
- }
116
106
 
117
- &[data-compact=row] {
118
- &:not([data-first=true]) {
119
- border-top-left-radius: 0;
120
- border-bottom-left-radius: 0;
121
- margin-left: -1px;
107
+ &[data-expanded=true] {
108
+ &:not([data-first=true]) {
109
+ margin-top: ${spacing[3]}px;
110
+ }
111
+
112
+ &:not([data-last=true]):not(:has(+ [data-expanded=true])) {
113
+ margin-bottom: ${spacing[3]}px
114
+ }
115
+ }
122
116
  }
123
-
124
- &:not([data-last=true]) {
125
- border-top-right-radius: 0;
126
- border-bottom-right-radius: 0;
117
+
118
+ &[data-compact=row] {
119
+ &:not([data-first=true]) {
120
+ border-top-left-radius: 0;
121
+ border-bottom-left-radius: 0;
122
+ margin-left: -1px;
123
+ }
124
+
125
+ &:not([data-last=true]) {
126
+ border-top-right-radius: 0;
127
+ border-bottom-right-radius: 0;
128
+ }
127
129
  }
128
130
  }
129
131
  `);
@@ -7,48 +7,50 @@ export const classes = defineInnerClasses('action-sheet', [
7
7
  'action'
8
8
  ]);
9
9
  export const style = defineCss(({ spacing, background, boxShadow, borderRadius, text, divider }) => css `
10
- .${classes.sheet} {
11
- position: absolute;
12
- padding: ${spacing[8]}px;
13
- }
14
-
15
- &[data-placement=top] {
10
+ @layer reset {
16
11
  .${classes.sheet} {
17
- transform-origin: top;
18
- inset: 0 0 auto;
12
+ position: absolute;
13
+ padding: ${spacing[8]}px;
19
14
  }
20
- }
21
-
22
- &[data-placement=bottom] {
23
- .${classes.sheet} {
24
- transform-origin: bottom;
25
- inset: auto 0 0;
15
+
16
+ &[data-placement=top] {
17
+ .${classes.sheet} {
18
+ transform-origin: top;
19
+ inset: 0 0 auto;
20
+ }
26
21
  }
27
- }
28
22
 
29
- .${classes.card} {
30
- text-align: center;
31
- background-color: ${background.content};
32
- box-shadow: ${boxShadow[1]};
33
- border-radius: ${borderRadius}px;
34
- overflow: hidden;
23
+ &[data-placement=bottom] {
24
+ .${classes.sheet} {
25
+ transform-origin: bottom;
26
+ inset: auto 0 0;
27
+ }
28
+ }
29
+
30
+ .${classes.card} {
31
+ text-align: center;
32
+ background-color: ${background.content};
33
+ box-shadow: ${boxShadow[1]};
34
+ border-radius: ${borderRadius}px;
35
+ overflow: hidden;
35
36
 
36
- &:not(:last-of-type) {
37
- margin-bottom: ${spacing[8]}px;
37
+ &:not(:last-of-type) {
38
+ margin-bottom: ${spacing[8]}px;
39
+ }
38
40
  }
39
- }
40
41
 
41
- .${classes.title} {
42
- line-height: 3;
43
- color: ${text.secondary};
44
- font-size: ${13 / 14}em;
45
- }
42
+ .${classes.title} {
43
+ line-height: 3;
44
+ color: ${text.secondary};
45
+ font-size: ${13 / 14}em;
46
+ }
46
47
 
47
- .${classes.action} {
48
- border-radius: 0;
48
+ .${classes.action} {
49
+ border-radius: 0;
49
50
 
50
- &:not(:last-of-type) {
51
- border-bottom: 1px solid ${divider};
51
+ &:not(:last-of-type) {
52
+ border-bottom: 1px solid ${divider};
53
+ }
52
54
  }
53
55
  }
54
56
  `);
@@ -18,62 +18,64 @@ export function useStyle({ color }) {
18
18
  const bg = c.alpha(mode === 'light' ? .1 : .16).string();
19
19
  const filledBg = mode === 'light' ? colorValue : c.alpha(.8).string();
20
20
  return css `
21
- display: flex;
22
- align-items: center;
23
- gap: ${spacing[3]}px;
24
- padding: ${spacing[4]}px ${spacing[5]}px;
25
- border-radius: ${borderRadius}px;
21
+ @layer reset {
22
+ display: flex;
23
+ align-items: center;
24
+ gap: ${spacing[3]}px;
25
+ padding: ${spacing[4]}px ${spacing[5]}px;
26
+ border-radius: ${borderRadius}px;
26
27
 
27
- .${classes.icon} {
28
- display: block;
29
- color: ${colorValue};
30
- }
31
-
32
- &[data-variant=standard],
33
- &[data-variant=outlined] {
34
- background-color: ${bg};
35
- }
28
+ .${classes.icon} {
29
+ display: block;
30
+ color: ${colorValue};
31
+ }
36
32
 
37
- &[data-variant=outlined] {
38
- border: 1px solid ${border};
39
- }
33
+ &[data-variant=standard],
34
+ &[data-variant=outlined] {
35
+ background-color: ${bg};
36
+ }
40
37
 
41
- &[data-variant=filled] {
42
- background-color: ${filledBg};
43
- color: #ffffff;
38
+ &[data-variant=outlined] {
39
+ border: 1px solid ${border};
40
+ }
44
41
 
45
- .${classes.icon} {
42
+ &[data-variant=filled] {
43
+ background-color: ${filledBg};
46
44
  color: #ffffff;
45
+
46
+ .${classes.icon} {
47
+ color: #ffffff;
48
+ }
47
49
  }
48
- }
49
50
 
50
- &:has(.${classes.title}) {
51
- .${classes.icon} {
52
- display: flex;
53
- font-size: ${20 / 14}em;
51
+ &:has(.${classes.title}) {
52
+ .${classes.icon} {
53
+ display: flex;
54
+ font-size: ${20 / 14}em;
55
+ }
54
56
  }
55
- }
56
57
 
57
- .${classes.content} {
58
- flex: 1;
59
- min-width: 0;
60
- }
58
+ .${classes.content} {
59
+ flex: 1;
60
+ min-width: 0;
61
+ }
61
62
 
62
- .${classes.title} {
63
- font-weight: bold;
64
- font-size: ${15 / 14}em;
63
+ .${classes.title} {
64
+ font-weight: bold;
65
+ font-size: ${15 / 14}em;
65
66
 
66
- & + .${classes.description} {
67
- margin-top: ${spacing[3]}px;
67
+ & + .${classes.description} {
68
+ margin-top: ${spacing[3]}px;
69
+ }
68
70
  }
69
- }
70
71
 
71
- &:not([data-variant=filled]) .${classes.description} {
72
- color: ${text.secondary};
73
- }
72
+ &:not([data-variant=filled]) .${classes.description} {
73
+ color: ${text.secondary};
74
+ }
74
75
 
75
- .${classes.close} {
76
- align-self: flex-start;
76
+ .${classes.close} {
77
+ align-self: flex-start;
78
+ }
77
79
  }
78
80
  `;
79
81
  }, [colorValue]);
@@ -5,53 +5,55 @@ export const classes = defineInnerClasses('anchor-list', [
5
5
  'indicator'
6
6
  ]);
7
7
  export const style = defineCss(({ colors, easing }) => css `
8
- position: relative;
9
-
10
- .${classes.item} {
11
- padding: 5px 0;
12
- color: inherit;
13
- text-decoration: none;
8
+ @layer reset {
14
9
  position: relative;
15
- transition: all .25s ${easing.easeOut};
16
- -webkit-tap-highlight-color: transparent;
17
10
 
18
- &:hover, &[data-active=true] {
19
- color: ${colors.primary.main};
11
+ .${classes.item} {
12
+ padding: 5px 0;
13
+ color: inherit;
14
+ text-decoration: none;
15
+ position: relative;
16
+ transition: all .25s ${easing.easeOut};
17
+ -webkit-tap-highlight-color: transparent;
18
+
19
+ &:hover, &[data-active=true] {
20
+ color: ${colors.primary.main};
21
+ }
22
+
23
+ &:not([data-active=true]):active {
24
+ transition: all 0s;
25
+ opacity: .7;
26
+ }
27
+
28
+ &::before {
29
+ content: '';
30
+ top: 8px;
31
+ display: none;
32
+ }
20
33
  }
21
34
 
22
- &:not([data-active=true]):active {
23
- transition: all 0s;
24
- opacity: .7;
35
+ .${classes.item}::before, .${classes.indicator} {
36
+ width: 2px;
37
+ height: 1em;
38
+ background: ${colors.primary.main};
39
+ position: absolute;
40
+ left: 0;
25
41
  }
26
-
27
- &:before {
28
- content: '';
29
- top: 8px;
30
- display: none;
42
+
43
+ .${classes.indicator} {
44
+ top: 0;
45
+ transition: top .3s ${easing.bounce};
31
46
  }
32
- }
33
47
 
34
- .${classes.item}:before, .${classes.indicator} {
35
- width: 2px;
36
- height: 1em;
37
- background: ${colors.primary.main};
38
- position: absolute;
39
- left: 0;
40
- }
41
48
 
42
- .${classes.indicator} {
43
- top: 0;
44
- transition: top .3s ${easing.bounce};
45
- }
46
-
47
-
48
- &:not([data-animating=true]) {
49
- .${classes.item}[data-active=true]:before {
50
- display: block;
51
- }
49
+ &:not([data-animating=true]) {
50
+ .${classes.item}[data-active=true]::before {
51
+ display: block;
52
+ }
52
53
 
53
- .${classes.indicator} {
54
- display: none;
54
+ .${classes.indicator} {
55
+ display: none;
56
+ }
55
57
  }
56
58
  }
57
59
  `);
@@ -1,27 +1,34 @@
1
1
  import { css } from '@emotion/react';
2
2
  import { defineInnerClasses, defineCss } from '../../utils';
3
+ import { defaultMonospaceFontFamily } from '../theme';
3
4
  export const classes = defineInnerClasses('app');
4
5
  export const appStyleCallback = (theme) => css `
5
- line-height: ${20 / 14};
6
- box-sizing: border-box;
7
- font-size: ${theme.fontSize}px;
8
- color: ${theme.text.primary};
9
- color-scheme: ${theme.mode};
10
- zoom: ${theme.zoom};
11
-
12
- *, *:before, *:after {
6
+ @layer reset {
7
+ line-height: ${20 / 14};
13
8
  box-sizing: border-box;
14
- font-family: ${theme.fontFamily};
15
- }
9
+ font-size: ${theme.fontSize}px;
10
+ color: ${theme.text.primary};
11
+ color-scheme: ${theme.mode};
12
+ zoom: ${theme.zoom};
16
13
 
17
- svg.MuiSvgIcon-root {
18
- font-size: 1em;
19
- transform: scale(1.2);
20
- }
14
+ :where(*, *::before, *::after) {
15
+ box-sizing: border-box;
16
+ font-family: ${theme.fontFamily};
17
+ }
18
+
19
+ :where(svg.MuiSvgIcon-root) {
20
+ font-size: 1em;
21
+ transform: scale(1.2);
22
+ }
21
23
 
22
- .anticon {
23
- line-height: 1;
24
- display: inline-flex;
24
+ :where(.anticon) {
25
+ line-height: 1;
26
+ display: inline-flex;
27
+ }
28
+
29
+ :where(code, pre) {
30
+ font-family: ${defaultMonospaceFontFamily};
31
+ }
25
32
  }
26
33
  `;
27
34
  export const style = defineCss(appStyleCallback);
@@ -6,30 +6,32 @@ export const classes = defineInnerClasses('avatar', [
6
6
  export function useStyle({ color }) {
7
7
  const colorValue = useColor(color);
8
8
  return useCss(({ borderRadius }) => css `
9
- line-height: 1;
10
- aspect-ratio: 1;
11
- display: inline-flex;
12
- align-items: center;
13
- justify-content: center;
14
- color: #ffffff;
15
- overflow: hidden;
9
+ @layer reset {
10
+ line-height: 1;
11
+ aspect-ratio: 1;
12
+ display: inline-flex;
13
+ align-items: center;
14
+ justify-content: center;
15
+ color: #ffffff;
16
+ overflow: hidden;
16
17
 
17
- &[data-shape=circular] {
18
- border-radius: 50%;
19
- }
18
+ &[data-shape=circular] {
19
+ border-radius: 50%;
20
+ }
20
21
 
21
- &[data-shape=square] {
22
- border-radius: ${borderRadius}px;
23
- }
22
+ &[data-shape=square] {
23
+ border-radius: ${borderRadius}px;
24
+ }
24
25
 
25
- &:not(:has(.${classes.img})) {
26
- background-color: ${colorValue};
27
- }
26
+ &:not(:has(.${classes.img})) {
27
+ background-color: ${colorValue};
28
+ }
28
29
 
29
- .${classes.img} {
30
- width: 100%;
31
- height: 100%;
32
- object-fit: cover;
30
+ .${classes.img} {
31
+ width: 100%;
32
+ height: 100%;
33
+ object-fit: cover;
34
+ }
33
35
  }
34
36
  `, [colorValue]);
35
37
  }
@@ -5,33 +5,35 @@ export const classes = defineInnerClasses('avatar-group', [
5
5
  'wrap'
6
6
  ]);
7
7
  export const style = defineCss(({ mode, easing }) => css `
8
- display: flex;
9
- justify-content: flex-start;
10
-
11
- .${classes.wrap} {
8
+ @layer reset {
12
9
  display: flex;
13
- flex-direction: row-reverse;
14
- }
15
-
16
- &[data-hoverable=true] {
10
+ justify-content: flex-start;
11
+
17
12
  .${classes.wrap} {
18
- cursor: pointer;
19
-
20
- &:hover {
21
- .${avatarClasses.root} {
22
- margin: 0;
13
+ display: flex;
14
+ flex-direction: row-reverse;
15
+ }
16
+
17
+ &[data-hoverable=true] {
18
+ .${classes.wrap} {
19
+ cursor: pointer;
20
+
21
+ &:hover {
22
+ .${avatarClasses.root} {
23
+ margin: 0;
24
+ }
23
25
  }
24
26
  }
25
27
  }
26
- }
27
-
28
- .${avatarClasses.root} {
29
- position: relative;
30
- border: 1px solid ${mode === 'light' ? '#ffffff' : '#999999'};
31
-
32
- &:not(:last-of-type) {
33
- transition: margin .25s ${easing.easeOut};
34
- margin-left: -6px;
28
+
29
+ .${avatarClasses.root} {
30
+ position: relative;
31
+ border: 1px solid ${mode === 'light' ? '#ffffff' : '#999999'};
32
+
33
+ &:not(:last-of-type) {
34
+ transition: margin .25s ${easing.easeOut};
35
+ margin-left: -6px;
36
+ }
35
37
  }
36
38
  }
37
39
  `);