@lt-ui/uikit 0.0.1 → 0.0.3

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 (210) hide show
  1. package/_internal/base-button/styles.module.css +1 -1
  2. package/_internal/field/_motion.css +0 -0
  3. package/_internal/field/field.module.css +21 -23
  4. package/_internal/floating/use-floating.d.ts +1 -1
  5. package/_internal/floating/use-floating.js +6 -2
  6. package/_internal/picker/picker-field.module.css +1 -1
  7. package/_internal/picker/picker-sheet.module.css +1 -1
  8. package/accordion/styles.module.css +3 -4
  9. package/alert/styles/alert.module.css +8 -8
  10. package/avatar/avatar-group.module.css +1 -1
  11. package/avatar/styles.module.css +3 -3
  12. package/badge/styles.module.css +3 -3
  13. package/breadcrumbs/styles.module.css +4 -4
  14. package/button/styles.module.css +7 -7
  15. package/calendar/styles.module.css +11 -11
  16. package/caption/styles.module.css +1 -1
  17. package/checkbox/styles/style.module.css +10 -12
  18. package/chip/styles.module.css +3 -3
  19. package/cjs/_internal/base-button/styles.module.css +1 -1
  20. package/cjs/_internal/field/_motion.css +0 -0
  21. package/cjs/_internal/field/field.module.css +21 -23
  22. package/cjs/_internal/floating/use-floating.js +6 -2
  23. package/cjs/_internal/picker/picker-field.module.css +1 -1
  24. package/cjs/_internal/picker/picker-sheet.module.css +1 -1
  25. package/cjs/accordion/styles.module.css +3 -4
  26. package/cjs/alert/styles/alert.module.css +8 -8
  27. package/cjs/avatar/avatar-group.module.css +1 -1
  28. package/cjs/avatar/styles.module.css +3 -3
  29. package/cjs/badge/styles.module.css +3 -3
  30. package/cjs/breadcrumbs/styles.module.css +4 -4
  31. package/cjs/button/styles.module.css +7 -7
  32. package/cjs/calendar/styles.module.css +11 -11
  33. package/cjs/caption/styles.module.css +1 -1
  34. package/cjs/checkbox/styles/style.module.css +10 -12
  35. package/cjs/chip/styles.module.css +3 -3
  36. package/cjs/date-picker/styles.module.css +10 -10
  37. package/cjs/drawer/styles.module.css +10 -12
  38. package/cjs/file/styles.module.css +3 -4
  39. package/cjs/hint/styles/buttons.module.css +2 -2
  40. package/cjs/hint/styles/hint-content.module.css +3 -3
  41. package/cjs/hint/styles/hint.module.css +2 -2
  42. package/cjs/image/image-viewer.js +3 -13
  43. package/cjs/image/image.js +4 -27
  44. package/cjs/image/use-image-preview.js +32 -0
  45. package/cjs/image/use-image-viewer.js +21 -0
  46. package/cjs/image/viewer.module.css +1 -1
  47. package/cjs/list/list-divider/styles.module.css +2 -2
  48. package/cjs/list/list-item/styles.module.css +2 -2
  49. package/cjs/list/list-section/styles.module.css +4 -4
  50. package/cjs/modal/modal.js +4 -10
  51. package/cjs/modal/styles/_animations.css +2 -2
  52. package/cjs/modal/styles/modal-footer.module.css +3 -3
  53. package/cjs/modal/styles/modal-header.module.css +5 -5
  54. package/cjs/modal/styles/modal.module.css +9 -4
  55. package/cjs/modal/use-modal.js +15 -1
  56. package/cjs/navigation/navigation-compact.js +2 -30
  57. package/cjs/navigation/navigation-row.js +5 -65
  58. package/cjs/navigation/navigation-views.js +3 -57
  59. package/cjs/navigation/navigation.js +2 -1
  60. package/cjs/navigation/styles/navigation.module.css +98 -81
  61. package/cjs/navigation/use-navigation-flyout.js +39 -0
  62. package/cjs/navigation/use-navigation-panel-stages.js +23 -0
  63. package/cjs/navigation/use-navigation-row.js +39 -0
  64. package/cjs/pagination/styles.module.css +2 -2
  65. package/cjs/pin-input/styles.module.css +2 -2
  66. package/cjs/progress-bar/styles.module.css +1 -1
  67. package/cjs/quantity-input/styles.module.css +3 -3
  68. package/cjs/radio/styles.module.css +4 -5
  69. package/cjs/radio-group/styles.module.css +1 -1
  70. package/cjs/segmented-control/styles/segmented-control-item.module.css +9 -9
  71. package/cjs/segmented-control/styles/segmented-control.module.css +4 -4
  72. package/cjs/select/components/select-field-multiselect-value.js +2 -2
  73. package/cjs/select/components/select-field.js +8 -6
  74. package/cjs/select/components/select-multiselect-panel.js +9 -67
  75. package/cjs/select/components/select-option-row.js +7 -53
  76. package/cjs/select/hooks/use-select-multiselect-panel-layout.js +53 -0
  77. package/cjs/select/hooks/use-select-option-row.js +23 -0
  78. package/cjs/select/hooks/use-select-view-model.js +3 -1
  79. package/cjs/select/styles/select-field.module.css +20 -1
  80. package/cjs/select/styles/select.module.css +2 -2
  81. package/cjs/select/views/select-view.js +4 -4
  82. package/cjs/select/views/styles.module.css +1 -1
  83. package/cjs/snackbar/snack-view.js +9 -42
  84. package/cjs/snackbar/styles/snack.module.css +1 -1
  85. package/cjs/snackbar/use-snack-view.js +16 -0
  86. package/cjs/switch/styles/base.module.css +2 -2
  87. package/cjs/tabs/styles/tab-list.module.css +1 -1
  88. package/cjs/tabs/styles/tab.module.css +6 -6
  89. package/cjs/tabs/tab-list.js +2 -20
  90. package/cjs/tabs/tab-panel.js +4 -39
  91. package/cjs/tabs/use-tab-list-navigation.js +27 -0
  92. package/cjs/tabs/use-tab-panel.js +12 -0
  93. package/cjs/textarea/styles.module.css +1 -1
  94. package/cjs/theme-provider/styles.module.css +6 -6
  95. package/cjs/time-picker/styles.module.css +9 -9
  96. package/cjs/time-picker/time-panel.js +2 -47
  97. package/cjs/time-picker/use-time-column-list.js +48 -0
  98. package/cjs/tooltip/tooltip.js +1 -1
  99. package/cjs/tree/styles.module.css +5 -5
  100. package/cjs/tree/tree-row.js +13 -73
  101. package/cjs/tree/tree-select.module.css +2 -2
  102. package/cjs/tree/use-tree-row.js +102 -0
  103. package/cjs/utils/class-names.js +3 -1
  104. package/date-picker/styles.module.css +10 -10
  105. package/drawer/styles.module.css +10 -12
  106. package/file/styles.module.css +3 -4
  107. package/hint/styles/buttons.module.css +2 -2
  108. package/hint/styles/hint-content.module.css +3 -3
  109. package/hint/styles/hint.module.css +2 -2
  110. package/image/image-viewer.js +3 -13
  111. package/image/image.js +5 -28
  112. package/image/use-image-preview.d.ts +10 -0
  113. package/image/use-image-preview.js +29 -0
  114. package/image/use-image-viewer.d.ts +8 -0
  115. package/image/use-image-viewer.js +18 -0
  116. package/image/viewer.module.css +1 -1
  117. package/input/fields/use-text-field.d.ts +2 -0
  118. package/list/list-divider/styles.module.css +2 -2
  119. package/list/list-item/styles.module.css +2 -2
  120. package/list/list-section/styles.module.css +4 -4
  121. package/masked-input/use-mask.d.ts +2 -0
  122. package/modal/modal.d.ts +1 -0
  123. package/modal/modal.js +4 -10
  124. package/modal/styles/_animations.css +2 -2
  125. package/modal/styles/modal-footer.module.css +3 -3
  126. package/modal/styles/modal-header.module.css +5 -5
  127. package/modal/styles/modal.module.css +9 -4
  128. package/modal/types.d.ts +5 -0
  129. package/modal/use-modal.d.ts +3 -1
  130. package/modal/use-modal.js +17 -3
  131. package/navigation/navigation-compact.d.ts +1 -2
  132. package/navigation/navigation-compact.js +3 -31
  133. package/navigation/navigation-row.d.ts +1 -2
  134. package/navigation/navigation-row.js +6 -33
  135. package/navigation/navigation-views.js +3 -24
  136. package/navigation/navigation.d.ts +1 -0
  137. package/navigation/navigation.js +2 -1
  138. package/navigation/styles/navigation.module.css +98 -81
  139. package/navigation/types.d.ts +3 -2
  140. package/navigation/use-navigation-flyout.d.ts +9 -0
  141. package/navigation/use-navigation-flyout.js +36 -0
  142. package/navigation/use-navigation-panel-stages.d.ts +5 -0
  143. package/navigation/use-navigation-panel-stages.js +20 -0
  144. package/navigation/use-navigation-row.d.ts +16 -0
  145. package/navigation/use-navigation-row.js +36 -0
  146. package/number-input/use-number-input.d.ts +2 -0
  147. package/package.json +6 -2
  148. package/pagination/styles.module.css +2 -2
  149. package/pin-input/styles.module.css +2 -2
  150. package/popover/types.d.ts +2 -2
  151. package/progress-bar/styles.module.css +1 -1
  152. package/quantity-input/styles.module.css +3 -3
  153. package/radio/styles.module.css +4 -5
  154. package/radio-group/styles.module.css +1 -1
  155. package/scss/_functions.scss +12 -24
  156. package/scss/_grid.scss +2 -2
  157. package/scss/_index.scss +1 -6
  158. package/scss/_interaction.scss +3 -3
  159. package/scss/_mixins.scss +5 -51
  160. package/scss/_tokens.generated.scss +578 -0
  161. package/scss/_tokens.scss +2 -396
  162. package/scss/_typography.scss +0 -1
  163. package/segmented-control/styles/segmented-control-item.module.css +9 -9
  164. package/segmented-control/styles/segmented-control.module.css +4 -4
  165. package/select/components/select-field-multiselect-value.d.ts +1 -0
  166. package/select/components/select-field-multiselect-value.js +2 -2
  167. package/select/components/select-field.d.ts +3 -1
  168. package/select/components/select-field.js +8 -6
  169. package/select/components/select-multiselect-panel.d.ts +3 -1
  170. package/select/components/select-multiselect-panel.js +8 -66
  171. package/select/components/select-option-row.js +7 -20
  172. package/select/hooks/use-select-multiselect-panel-layout.d.ts +14 -0
  173. package/select/hooks/use-select-multiselect-panel-layout.js +49 -0
  174. package/select/hooks/use-select-option-row.d.ts +13 -0
  175. package/select/hooks/use-select-option-row.js +20 -0
  176. package/select/hooks/use-select-view-model.d.ts +4 -2
  177. package/select/hooks/use-select-view-model.js +3 -1
  178. package/select/select.d.ts +3 -2
  179. package/select/styles/select-field.module.css +20 -1
  180. package/select/styles/select.module.css +2 -2
  181. package/select/types.d.ts +6 -3
  182. package/select/views/select-view.js +4 -4
  183. package/select/views/styles.module.css +1 -1
  184. package/snackbar/snack-view.js +7 -7
  185. package/snackbar/styles/snack.module.css +1 -1
  186. package/snackbar/use-snack-view.d.ts +8 -0
  187. package/snackbar/use-snack-view.js +13 -0
  188. package/switch/styles/base.module.css +2 -2
  189. package/tabs/styles/tab-list.module.css +1 -1
  190. package/tabs/styles/tab.module.css +6 -6
  191. package/tabs/tab-list.js +4 -22
  192. package/tabs/tab-panel.js +4 -6
  193. package/tabs/use-tab-list-navigation.d.ts +2 -0
  194. package/tabs/use-tab-list-navigation.js +24 -0
  195. package/tabs/use-tab-panel.d.ts +6 -0
  196. package/tabs/use-tab-panel.js +9 -0
  197. package/textarea/styles.module.css +1 -1
  198. package/theme-provider/styles.module.css +6 -6
  199. package/time-picker/styles.module.css +9 -9
  200. package/time-picker/time-panel.js +2 -47
  201. package/time-picker/use-time-column-list.d.ts +7 -0
  202. package/time-picker/use-time-column-list.js +45 -0
  203. package/tooltip/tooltip.js +1 -1
  204. package/tree/styles.module.css +5 -5
  205. package/tree/tree-row.js +15 -75
  206. package/tree/tree-select.module.css +2 -2
  207. package/tree/use-tree-row.d.ts +331 -0
  208. package/tree/use-tree-row.js +99 -0
  209. package/utils/class-names.d.ts +1 -1
  210. package/utils/class-names.js +3 -1
@@ -354,6 +354,7 @@ export declare function useNumberInput(props: NumberInputProps, ref: React.Ref<H
354
354
  onTransitionStartCapture?: React.TransitionEventHandler<HTMLInputElement> | undefined;
355
355
  readOnly?: boolean | undefined | undefined;
356
356
  required?: boolean | undefined | undefined;
357
+ webkitdirectory?: boolean | string | undefined | undefined;
357
358
  } | {
358
359
  id: string;
359
360
  ref: React.RefCallback<HTMLInputElement>;
@@ -660,5 +661,6 @@ export declare function useNumberInput(props: NumberInputProps, ref: React.Ref<H
660
661
  onTransitionStartCapture?: React.TransitionEventHandler<HTMLInputElement> | undefined;
661
662
  readOnly?: boolean | undefined | undefined;
662
663
  required?: boolean | undefined | undefined;
664
+ webkitdirectory?: boolean | string | undefined | undefined;
663
665
  };
664
666
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lt-ui/uikit",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "LT UI",
5
5
  "engines": {
6
6
  "node": ">=18"
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@lt-ui/i18n": "0.0.1",
14
- "@lt-ui/tokens": "0.0.1",
14
+ "@lt-ui/tokens": "0.0.2",
15
15
  "clsx": "^2.1.1"
16
16
  },
17
17
  "main": "./cjs/index.js",
@@ -347,6 +347,10 @@
347
347
  "sass": "./scss/_index.scss",
348
348
  "default": "./scss/_index.scss"
349
349
  },
350
+ "./scss/tokens.generated": {
351
+ "sass": "./scss/_tokens.generated.scss",
352
+ "default": "./scss/_tokens.generated.scss"
353
+ },
350
354
  "./*": "./*"
351
355
  },
352
356
  "sideEffects": [
@@ -1,7 +1,7 @@
1
1
  .pagination {
2
2
  display: flex;
3
3
  flex-wrap: wrap;
4
- gap: 12px 24px;
4
+ gap: var(--space-12) var(--space-24);
5
5
  align-items: center;
6
6
  justify-content: space-between;
7
7
  width: 100%;
@@ -75,7 +75,7 @@
75
75
  .pageSize {
76
76
  --field-default-width: 96px;
77
77
  display: flex;
78
- gap: 8px;
78
+ gap: var(--space-8);
79
79
  align-items: center;
80
80
  min-width: 96px;
81
81
  }
@@ -1,8 +1,8 @@
1
1
  .pinInput {
2
2
  --_size: var(--control-height-l);
3
- --_gap: 8px;
3
+ --_gap: var(--space-8);
4
4
  display: inline-grid;
5
- gap: 4px;
5
+ gap: var(--space-4);
6
6
  }
7
7
  .pinInput.s {
8
8
  --_size: var(--control-height-s);
@@ -58,10 +58,10 @@ type PopoverPropsOwn = OverlayContainerProps & {
58
58
  shift?: boolean;
59
59
  /**
60
60
  * Ширина поповера равна ширине активатора (выпадающие списки). `'min'` — не уже активатора, но по длине
61
- * содержимого без переноса.
61
+ * содержимого без переноса. Число задаёт фиксированную ширину в пикселях.
62
62
  * @default false
63
63
  */
64
- matchWidth?: boolean | 'min';
64
+ matchWidth?: boolean | 'min' | number;
65
65
  /**
66
66
  * Задержка открытия для `hover`, мс.
67
67
  * @default 0
@@ -21,7 +21,7 @@
21
21
 
22
22
  .line {
23
23
  display: flex;
24
- gap: 12px;
24
+ gap: var(--space-12);
25
25
  align-items: center;
26
26
  }
27
27
 
@@ -31,12 +31,12 @@
31
31
  --input-transform-left: 7px;
32
32
  }
33
33
  .input.underline.s {
34
- --input-left-padding: 4px;
35
- --input-right-padding: 4px;
34
+ --input-left-padding: var(--space-4);
35
+ --input-right-padding: var(--space-4);
36
36
  }
37
37
  .input.underline.m {
38
38
  --input-left-padding: 9px;
39
- --input-right-padding: 8px;
39
+ --input-right-padding: var(--space-8);
40
40
  }
41
41
  .input.underline.l {
42
42
  --input-left-padding: 10px;
@@ -10,7 +10,6 @@
10
10
  --outer-color: var(--lt-ui-radio-border-color, var(--control-secondary));
11
11
  --inner-color: var(--lt-ui-radio-color, var(--control-primary));
12
12
  --inner-width: 0px;
13
- --transition-duration: 350ms;
14
13
  }
15
14
  .radioIcon.m {
16
15
  --size: var(--lt-ui-radio-size-m, 20px);
@@ -39,7 +38,7 @@
39
38
  content: "";
40
39
  border-radius: var(--rounding-circular);
41
40
  box-shadow: 0 0 0 var(--inner-width) var(--inner-color) inset;
42
- transition: box-shadow var(--transition-duration) cubic-bezier(0.4, 0, 0.5, 2.6);
41
+ transition: box-shadow 350ms cubic-bezier(0.4, 0, 0.5, 2.6);
43
42
  }
44
43
 
45
44
  .inputInner {
@@ -104,7 +103,7 @@
104
103
  .radio {
105
104
  display: flex;
106
105
  align-items: flex-start;
107
- padding: 8px;
106
+ padding: var(--space-8);
108
107
  color: var(--text-primary);
109
108
  cursor: pointer;
110
109
  user-select: none;
@@ -137,7 +136,7 @@
137
136
  }
138
137
  @media (pointer: coarse) {
139
138
  .radio {
140
- padding: 12px;
139
+ padding: var(--space-12);
141
140
  }
142
141
  }
143
142
  .radio.block {
@@ -145,7 +144,7 @@
145
144
  }
146
145
  .radio .labelText {
147
146
  display: block;
148
- margin-inline-start: 8px;
147
+ margin-inline-start: var(--space-8);
149
148
  font-size: inherit;
150
149
  line-height: inherit;
151
150
  color: var(--label-color, var(--text-primary));
@@ -8,5 +8,5 @@
8
8
 
9
9
  .horizontal {
10
10
  flex-flow: row wrap;
11
- gap: 8px 24px;
11
+ gap: var(--space-8) var(--space-24);
12
12
  }
@@ -1,21 +1,12 @@
1
1
  // Доступ к токенам. Функции возвращают `var(--…)`, поэтому значения подхватывают тему (ThemeProvider);
2
2
  // неизвестное имя — ошибка сборки, а не молчаливо пустой стиль.
3
3
  @use 'sass:list';
4
- @use 'sass:map';
5
4
  @use 'sass:string';
6
5
  @use 'tokens' as t;
7
6
 
8
- @function -require($map, $key, $kind) {
9
- @if not map.has-key($map, $key) {
10
- @error 'Unknown #{$kind} token `#{$key}`. Available: #{map.keys($map)}';
11
- }
12
-
13
- @return $key;
14
- }
15
-
16
- /// Цвет: `color(text-primary)` → `var(--text-primary)`
7
+ /// Цвет: `color(text-primary)` → `var(--text-primary)`.
17
8
  @function color($name) {
18
- @return var(--#{-require(t.$colors, $name, 'color')});
9
+ @return t.color($name);
19
10
  }
20
11
 
21
12
  /// Цвет с прозрачностью в процентах: `alpha(control-invert, 40)`. Заменяет авто-варианты `*_opacity-N`
@@ -25,50 +16,47 @@
25
16
 
26
17
  /// Отступ: `space(8)` → `var(--space-8)`; число равно значению в px
27
18
  @function space($px) {
28
- @return var(--space-#{-require(t.$spacings, $px, 'spacing')});
19
+ @return t.space($px);
29
20
  }
30
21
 
31
22
  /// Скругление: `rounding(m)`
32
23
  @function rounding($name) {
33
- @return var(--rounding-#{-require(t.$roundings, $name, 'rounding')});
24
+ @return t.rounding($name);
34
25
  }
35
26
 
36
27
  /// Тень: `shadow(m)`, `shadow(m-up)`
37
28
  @function shadow($name) {
38
- @return var(--box-shadow-#{-require(t.$shadows, $name, 'shadow')});
29
+ @return t.shadow($name);
39
30
  }
40
31
 
41
32
  /// Прозрачность в процентах: `opacity(40)`
42
33
  @function opacity($percent) {
43
- @return var(--opacity-#{-require(t.$opacities, $percent, 'opacity')});
34
+ @return t.opacity($percent);
44
35
  }
45
36
 
46
37
  /// Токен компонента: `token(button-radius)` → `var(--lt-ui-button-radius, var(--rounding-m))`.
47
38
  /// Приложение меняет переменную (`ThemeProvider components`), без настройки действует значение по умолчанию из реестра
48
39
  @function token($name) {
49
- @return var(
50
- --lt-ui-#{-require(t.$component-tokens, $name, 'component')},
51
- #{map.get(t.$component-tokens, $name)}
52
- );
40
+ @return t.component($name);
53
41
  }
54
42
 
55
43
  /// Ширина границы брейкпоинта в px: `breakpoint-width(sm)` → `480px`
56
44
  @function breakpoint-width($name) {
57
- @return map.get(t.$breakpoints, -require(t.$breakpoints, $name, 'breakpoint'));
45
+ @return t.breakpoint($name);
58
46
  }
59
47
 
60
48
  /// Слой наложения: `layer(modal)` → `var(--z-modal)`
61
49
  @function layer($name) {
62
- @return var(--z-#{-require(t.$layers, $name, 'layer')});
50
+ @return t.layer($name);
63
51
  }
64
52
 
65
53
  /// Шрифтовой стек: `font(title)`
66
54
  @function font($name) {
67
- @return var(--font-#{-require(t.$fonts, $name, 'font')});
55
+ @return t.font($name);
68
56
  }
69
57
 
70
58
  @function -breakpoint-names() {
71
- @return map.keys(t.$breakpoints);
59
+ @return t.breakpoint-names();
72
60
  }
73
61
 
74
62
  @function -breakpoint-next($name) {
@@ -109,5 +97,5 @@
109
97
 
110
98
  /// Цель нажатия: `target-size(min)` — 24px, `target-size(touch)` — 44px по умолчанию.
111
99
  @function target-size($name) {
112
- @return var(--target-size-#{-require(t.$target-sizes, $name, 'target size')});
100
+ @return t.target-size($name);
113
101
  }
package/scss/_grid.scss CHANGED
@@ -50,7 +50,7 @@ $-layout-min-width: 320px;
50
50
  }
51
51
 
52
52
  @mixin -vars($kind) {
53
- @each $preset, $breakpoints in t.$grids {
53
+ @each $preset, $breakpoints in t.grid-presets() {
54
54
  @if $preset == 'fixed' {
55
55
  @include -preset-vars($breakpoints, $kind);
56
56
  } @else {
@@ -74,7 +74,7 @@ $-layout-min-width: 320px;
74
74
  /// Классы `.only-*`, `.from-*`, `.to-*` по одной шкале: вне диапазона `display: none`, внутри — `contents`
75
75
  @mixin adaptive-classes {
76
76
  @each $range in only, from, to {
77
- @each $name in map.keys(t.$breakpoints) {
77
+ @each $name in t.breakpoint-names() {
78
78
  .#{$range}-#{$name} {
79
79
  display: none;
80
80
  }
package/scss/_index.scss CHANGED
@@ -1,9 +1,4 @@
1
- // Публичный Sass-API @lt-ui/uikit: `@use '@lt-ui/uikit/scss' as f;`
2
- // f.color(text-primary) f.space(8) f.rounding(m) f.shadow(m) f.alpha(text-primary, 40)
3
- // @include f.respond-to(md, from); @include f.theme-tokens;
4
- // Карты токенов (`$colors`, `$spacings`…) — внутренность библиотеки: наружу отдаются только функции и миксины
5
- @forward 'tokens' hide $colors, $spacings, $roundings, $shadows, $opacities, $control-heights, $target-sizes,
6
- $breakpoints, $layers, $fonts, $grids, $component-tokens;
1
+ // Общие функции и миксины UIKit. Токены подключаются по смысловым группам.
7
2
  @forward 'functions';
8
3
  @forward 'mixins';
9
4
  @forward 'grid';
@@ -1,9 +1,9 @@
1
+ @use './tokens.generated' as t;
1
2
  @use 'sass:meta';
2
- @use 'functions' as f;
3
3
 
4
4
  /// Резервирует место для цели в потоке, сохраняя размер рисунка.
5
5
  /// Центрирование рисунка задаёт сам компонент. Touch-размер подключается явно.
6
- @mixin hit-target($minimum: f.target-size(min), $touch: null) {
6
+ @mixin hit-target($minimum: t.target-size(min), $touch: null) {
7
7
  min-inline-size: $minimum;
8
8
  min-block-size: $minimum;
9
9
 
@@ -30,7 +30,7 @@
30
30
 
31
31
  &::#{$pseudo} {
32
32
  position: absolute;
33
- inset: calc(-1 * #{$block}) calc(-1 * #{$inline});
33
+ inset: calc(-1 * $block) calc(-1 * $inline);
34
34
  content: '';
35
35
  }
36
36
  }
package/scss/_mixins.scss CHANGED
@@ -48,61 +48,15 @@
48
48
 
49
49
  /// Цвета светлой схемы: возвращают схему внутри тёмной области (`data-lt-ui-theme='light'`)
50
50
  @mixin theme-colors-light {
51
- @each $name, $value in t.$colors {
52
- --#{$name}: #{$value};
53
- }
54
-
55
- @each $name, $value in t.$shadows {
56
- --box-shadow-#{$name}: #{$value};
57
- }
51
+ @include t.theme-colors-light;
58
52
  }
59
53
 
60
- /// Цвета тёмной схемы: только изменённые токены (`data-lt-ui-theme='dark'`)
54
+ /// Цвета тёмной схемы: только изменённые токены.
61
55
  @mixin theme-colors-dark {
62
- @each $name, $value in t.$colors-dark {
63
- --#{$name}: #{$value};
64
- }
65
-
66
- @each $name, $value in t.$shadows-dark {
67
- --box-shadow-#{$name}: #{$value};
68
- }
56
+ @include t.theme-colors-dark;
69
57
  }
70
58
 
71
- /// Все токены как CSS-переменные. Подключается в ThemeProvider; в приложении — для своей темы.
59
+ /// Все токены как CSS-переменные без повторного определения их значений.
72
60
  @mixin theme-tokens {
73
- @each $name, $value in t.$colors {
74
- --#{$name}: #{$value};
75
- }
76
-
77
- @each $px, $value in t.$spacings {
78
- --space-#{$px}: #{$value};
79
- }
80
-
81
- @each $name, $value in t.$roundings {
82
- --rounding-#{$name}: #{$value};
83
- }
84
-
85
- @each $name, $value in t.$shadows {
86
- --box-shadow-#{$name}: #{$value};
87
- }
88
-
89
- @each $percent, $value in t.$opacities {
90
- --opacity-#{$percent}: #{$value};
91
- }
92
-
93
- @each $name, $value in t.$control-heights {
94
- --control-height-#{$name}: #{$value};
95
- }
96
-
97
- @each $name, $value in t.$target-sizes {
98
- --target-size-#{$name}: #{$value};
99
- }
100
-
101
- @each $name, $value in t.$layers {
102
- --z-#{$name}: #{$value};
103
- }
104
-
105
- @each $name, $value in t.$fonts {
106
- --font-#{$name}: #{$value};
107
- }
61
+ @include t.theme-tokens;
108
62
  }