burne-ui 2.0.3 → 2.0.5

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 (64) hide show
  1. package/cli/skin-build.mjs +4 -2
  2. package/cli/skin-stylesheet.d.mts +9 -6
  3. package/cli/skin-stylesheet.mjs +20 -4
  4. package/dist/cli/skin-stylesheet.js +11 -4
  5. package/dist/components/composite/AlertDialog/alertDialogStyles.js +2 -2
  6. package/dist/components/composite/ButtonGroup/buttonGroupStyles.js +5 -2
  7. package/dist/components/core/Alert/alertStyles.js +2 -3
  8. package/dist/components/core/Avatar/avatarStyles.js +2 -2
  9. package/dist/components/core/Badge/badgeStyles.js +5 -4
  10. package/dist/components/core/Button/buttonStyles.js +3 -5
  11. package/dist/components/core/Calendar/calendarStyles.js +2 -2
  12. package/dist/components/core/Card/cardStyles.js +1 -0
  13. package/dist/components/core/CloseButton/closeButtonStyles.js +1 -0
  14. package/dist/components/core/ComboBox/comboBoxStyles.js +2 -3
  15. package/dist/components/core/DatePicker/datePickerParts.js +7 -0
  16. package/dist/components/core/DatePicker/datePickerStyles.js +2 -3
  17. package/dist/components/core/Dialog/dialogStyles.js +2 -2
  18. package/dist/components/core/Disclosure/disclosureStyles.js +5 -3
  19. package/dist/components/core/Drawer/drawerStyles.js +2 -2
  20. package/dist/components/core/Dropdown/dropdownStyles.js +2 -2
  21. package/dist/components/core/Expandable/expandableStyles.js +2 -2
  22. package/dist/components/core/Field/fieldParts.d.ts +1 -1
  23. package/dist/components/core/Input/inputStyles.js +2 -3
  24. package/dist/components/core/Kbd/kbdStyles.js +2 -3
  25. package/dist/components/core/ListBox/listBoxStyles.js +2 -2
  26. package/dist/components/core/NumberInput/numberInputStyles.js +2 -3
  27. package/dist/components/core/PinInput/pinInputStyles.js +2 -3
  28. package/dist/components/core/Popover/popoverStyles.js +3 -3
  29. package/dist/components/core/SearchInput/searchInputStyles.js +1 -0
  30. package/dist/components/core/Select/selectStyles.js +2 -3
  31. package/dist/components/core/SelectionIndicator/selectionIndicatorStyles.js +6 -13
  32. package/dist/components/core/SelectionThumb/selectionThumbStyles.js +3 -4
  33. package/dist/components/core/Slider/sliderStyles.js +3 -2
  34. package/dist/components/core/Surface/surfaceStyles.js +2 -3
  35. package/dist/components/core/Switch/switchStyles.js +3 -4
  36. package/dist/components/core/Table/tableStyles.js +6 -6
  37. package/dist/components/core/Tabs/tabsParts.js +2 -2
  38. package/dist/components/core/Tabs/tabsStyles.d.ts +3 -1
  39. package/dist/components/core/Tabs/tabsStyles.js +8 -3
  40. package/dist/components/core/Tabs/useSlidingTabIndicator.d.ts +2 -2
  41. package/dist/components/core/TagsInput/tagsInputStyles.js +2 -3
  42. package/dist/components/core/TextArea/textAreaStyles.js +1 -0
  43. package/dist/components/core/TimeField/timeFieldStyles.js +1 -0
  44. package/dist/components/core/Toast/toastStyles.js +2 -2
  45. package/dist/components/core/ToggleButton/toggleButtonStyles.js +1 -0
  46. package/dist/components/core/Tooltip/tooltipStyles.js +3 -3
  47. package/dist/components/core/utils/slotMotion/createMotionScope.js +4 -0
  48. package/dist/components/core/utils/slotMotion/useMotionPart.js +3 -3
  49. package/dist/internal.js +1 -2
  50. package/dist/skins/resolveVariantVisual.d.ts +6 -0
  51. package/dist/skins/resolveVariantVisual.js +7 -1
  52. package/dist/skins/skinDocument.d.ts +10 -3
  53. package/dist/skins/skinDocument.js +11 -6
  54. package/dist/skins/skinTypes.d.ts +11 -3
  55. package/dist/studio/designDocument.js +1 -2
  56. package/dist/studio/liveSkinSlots.d.ts +2 -0
  57. package/dist/studio/liveSkinSlots.js +8 -0
  58. package/dist/studio/studioMode.d.ts +4 -4
  59. package/dist/studio/studioMode.js +3 -17
  60. package/dist/studio/studioModeContext.d.ts +4 -2
  61. package/dist/studio/studioModeContext.js +7 -6
  62. package/dist/studio.d.ts +3 -2
  63. package/dist/studio.js +3 -3
  64. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { resolveVariantVisual } from "../../../skins/resolveVariantVisual.js";
1
+ import { resolveVariantVisual, skinVisualClass } from "../../../skins/resolveVariantVisual.js";
2
2
  import { cn } from "../../../utils/cn.js";
3
3
  import { KIT_SELECTION_INDICATOR_VARIANTS } from "./selectionIndicatorTypes.js";
4
4
  const SELECTION_INDICATOR_SIZE_CLASS = {
@@ -100,7 +100,7 @@ function selectionIndicatorFillClass(variant) {
100
100
  return cn(SELECTION_INDICATOR_FILL_BASE_CLASS, visual.className);
101
101
  }
102
102
  const surfaceClass = visual.key === "secondary" ? SELECTION_INDICATOR_FILL_SECONDARY_CLASS : SELECTION_INDICATOR_FILL_CLASS;
103
- return cn(SELECTION_INDICATOR_FILL_BASE_CLASS, surfaceClass);
103
+ return cn(SELECTION_INDICATOR_FILL_BASE_CLASS, surfaceClass, visual.extend);
104
104
  }
105
105
  function selectionIndicatorMarkColorClass(variant) {
106
106
  const key = resolveVariantVisual(
@@ -131,17 +131,10 @@ function selectionIndicatorVariantClass(variant, _selected) {
131
131
  KIT_SELECTION_INDICATOR_VARIANTS,
132
132
  "selectionIndicator.root"
133
133
  );
134
- if (visual.className !== void 0) return visual.className;
135
- switch (visual.key) {
136
- case "default":
137
- return "border border-primary bg-surface";
138
- case "secondary":
139
- return "border-token bg-secondary";
140
- case "outline":
141
- return "border border-primary bg-surface";
142
- default:
143
- return "border border-primary bg-surface";
144
- }
134
+ return skinVisualClass(
135
+ visual,
136
+ visual.key === "secondary" ? "border-token bg-secondary" : "border border-primary bg-surface"
137
+ );
145
138
  }
146
139
  export {
147
140
  SELECTION_INDICATOR_DASH_CLASS,
@@ -1,4 +1,4 @@
1
- import { resolveVariantVisual } from "../../../skins/resolveVariantVisual.js";
1
+ import { resolveVariantVisual, skinVisualClass } from "../../../skins/resolveVariantVisual.js";
2
2
  import { cn } from "../../../utils/cn.js";
3
3
  import { SELECTION_INDICATOR_ICON_CLASS, SELECTION_INDICATOR_RADIUS_CLASS, SELECTION_INDICATOR_SHELL_CLASS } from "../SelectionIndicator/selectionIndicatorStyles.js";
4
4
  import { KIT_SELECTION_THUMB_VARIANTS } from "./selectionThumbTypes.js";
@@ -17,7 +17,7 @@ function selectionThumbShellClass({
17
17
  KIT_SELECTION_THUMB_VARIANTS,
18
18
  "selectionIndicator.root"
19
19
  );
20
- const surface = visual.className !== void 0 ? cn(SELECTION_THUMB_SHELL_LAYOUT_CLASS, visual.className) : SELECTION_THUMB_SHELL_DEFAULT_CLASS;
20
+ const surface = visual.className !== void 0 ? cn(SELECTION_THUMB_SHELL_LAYOUT_CLASS, visual.className) : cn(SELECTION_THUMB_SHELL_DEFAULT_CLASS, visual.extend);
21
21
  return cn(
22
22
  SELECTION_INDICATOR_SHELL_CLASS,
23
23
  SELECTION_INDICATOR_RADIUS_CLASS[size],
@@ -32,8 +32,7 @@ function selectionThumbIconColorClass(variant = "default") {
32
32
  KIT_SELECTION_THUMB_VARIANTS,
33
33
  "selectionThumbIcon.root"
34
34
  );
35
- if (visual.className !== void 0) return visual.className;
36
- return "text-primary";
35
+ return skinVisualClass(visual, "text-primary");
37
36
  }
38
37
  function selectionThumbIconRootClass({
39
38
  variant = "default",
@@ -1,6 +1,6 @@
1
1
  import { SELECTION_INDICATOR_RADIUS_CLASS } from "../SelectionIndicator/selectionIndicatorStyles.js";
2
2
  import { scaleFieldRootClassName } from "../utils/scaleFieldRootClassName.js";
3
- import { resolveVariantVisual, usesKitElevation } from "../../../skins/resolveVariantVisual.js";
3
+ import { resolveVariantVisual, skinVisualClass, usesKitElevation } from "../../../skins/resolveVariantVisual.js";
4
4
  import { KIT_SLIDER_VARIANTS } from "./sliderTypes.js";
5
5
  import { cn } from "../../../utils/cn.js";
6
6
  function sliderThicknessToCss(thickness) {
@@ -72,7 +72,7 @@ function sliderFillClass({
72
72
  className
73
73
  }) {
74
74
  const visual = resolveVariantVisual(variant, KIT_SLIDER_VARIANTS, "slider.fill");
75
- const surface = visual.className !== void 0 ? visual.className : SLIDER_FILL_DEFAULT_CLASS;
75
+ const surface = skinVisualClass(visual, SLIDER_FILL_DEFAULT_CLASS);
76
76
  return cn(
77
77
  SLIDER_FILL_LAYOUT_CLASS,
78
78
  isHorizontal ? SLIDER_FILL_HORIZONTAL_CLASS : SLIDER_FILL_VERTICAL_CLASS,
@@ -102,6 +102,7 @@ function sliderTrackHitAreaClass({
102
102
  skinSurface && SELECTION_INDICATOR_RADIUS_CLASS[size],
103
103
  skinSurface && SLIDER_RAIL_SKIN_SHAPE_CLASS,
104
104
  visual.className,
105
+ visual.extend,
105
106
  slotClass,
106
107
  className
107
108
  );
@@ -1,4 +1,4 @@
1
- import { resolveVariantVisual } from "../../../skins/resolveVariantVisual.js";
1
+ import { resolveVariantVisual, skinVisualClass } from "../../../skins/resolveVariantVisual.js";
2
2
  import { cn } from "../../../utils/cn.js";
3
3
  import { KIT_SURFACE_VARIANTS } from "./surfaceTypes.js";
4
4
  const SURFACE_VARIANT_CLASS = {
@@ -35,8 +35,7 @@ function surfaceRootClass({
35
35
  }) {
36
36
  const visual = resolveVariantVisual(variant, KIT_SURFACE_VARIANTS, "surface.root");
37
37
  return cn(
38
- visual.className !== void 0 ? visual.className : SURFACE_BASE_CLASS,
39
- visual.className === void 0 && SURFACE_VARIANT_CLASS[visual.key],
38
+ skinVisualClass(visual, SURFACE_BASE_CLASS, SURFACE_VARIANT_CLASS[visual.key]),
40
39
  SURFACE_RADIUS_CLASS[radius],
41
40
  SURFACE_SHADOW_CLASS[shadow],
42
41
  SURFACE_PADDING_CLASS[padding],
@@ -1,7 +1,7 @@
1
1
  import { SELECTION_INDICATOR_RADIUS_CLASS } from "../SelectionIndicator/selectionIndicatorStyles.js";
2
2
  import { optionControlGridClass, optionSecondaryCellClass, optionErrorRow, optionLabelCellClass, optionControlCellClass } from "../utils/optionControlGridLayout.js";
3
3
  import { sliderThicknessToCss } from "../Slider/sliderStyles.js";
4
- import { resolveVariantVisual } from "../../../skins/resolveVariantVisual.js";
4
+ import { resolveVariantVisual, skinVisualClass } from "../../../skins/resolveVariantVisual.js";
5
5
  import { SWITCH_LAYOUT } from "./switchGeometry.js";
6
6
  import { KIT_SWITCH_VARIANTS } from "./switchTypes.js";
7
7
  import { cn } from "../../../utils/cn.js";
@@ -80,7 +80,7 @@ function switchTrackClass({
80
80
  KIT_SWITCH_VARIANTS,
81
81
  "selectionIndicator.root"
82
82
  );
83
- const surface = visual.className !== void 0 ? visual.className : SWITCH_TRACK_DEFAULT_CLASS;
83
+ const surface = skinVisualClass(visual, SWITCH_TRACK_DEFAULT_CLASS);
84
84
  return cn(
85
85
  SWITCH_TRACK_BASE_CLASS,
86
86
  SELECTION_INDICATOR_RADIUS_CLASS[size],
@@ -92,8 +92,7 @@ function switchTrackClass({
92
92
  }
93
93
  function switchFillSurfaceClass(variant = "default") {
94
94
  const visual = resolveVariantVisual(variant, KIT_SWITCH_VARIANTS, "switch.fill");
95
- if (visual.className !== void 0) return visual.className;
96
- return SWITCH_FILL_COLOR_CLASS;
95
+ return skinVisualClass(visual, SWITCH_FILL_COLOR_CLASS);
97
96
  }
98
97
  function switchTrackCustomStyle(thickness) {
99
98
  if (thickness == null) return void 0;
@@ -1,5 +1,5 @@
1
1
  import { TEXT_COLOR_TRANSITION, hoverVariant } from "../utils/hoverVariant.js";
2
- import { resolveVariantVisual } from "../../../skins/resolveVariantVisual.js";
2
+ import { resolveVariantVisual, skinVisualClass } from "../../../skins/resolveVariantVisual.js";
3
3
  import { cn } from "../../../utils/cn.js";
4
4
  import { KIT_TABLE_VARIANTS } from "./tableTypes.js";
5
5
  const TABLE_ROOT_BASE_CLASS = "w-full";
@@ -99,7 +99,7 @@ function tableRootClass({
99
99
  const kitDefault = visual.className === void 0 && visual.key === "default";
100
100
  return cn(
101
101
  TABLE_ROOT_BASE_CLASS,
102
- visual.className !== void 0 ? visual.className : TABLE_ROOT_VARIANT_CLASS[visual.key],
102
+ skinVisualClass(visual, TABLE_ROOT_VARIANT_CLASS[visual.key]),
103
103
  kitDefault && !stickyHeader && TABLE_ROOT_CLIP_CLASS,
104
104
  slotClass,
105
105
  className
@@ -115,7 +115,7 @@ function tableContentClass({
115
115
  return cn(
116
116
  TABLE_CONTENT_BASE_CLASS,
117
117
  columnResize && TABLE_CONTENT_FIXED_CLASS,
118
- visual.className !== void 0 ? visual.className : TABLE_CONTENT_VARIANT_CLASS[visual.key],
118
+ skinVisualClass(visual, TABLE_CONTENT_VARIANT_CLASS[visual.key]),
119
119
  slotClass,
120
120
  className
121
121
  );
@@ -132,7 +132,7 @@ function tableColumnClass({
132
132
  const visual = resolveVariantVisual(variant, KIT_TABLE_VARIANTS, "table.column");
133
133
  return cn(
134
134
  TABLE_COLUMN_BASE_CLASS,
135
- visual.className !== void 0 ? visual.className : TABLE_COLUMN_VARIANT_CLASS[visual.key],
135
+ skinVisualClass(visual, TABLE_COLUMN_VARIANT_CLASS[visual.key]),
136
136
  stickyHeader && TABLE_COLUMN_STICKY_CLASS[visual.key],
137
137
  TABLE_SIZE_TEXT_CLASS[size],
138
138
  TABLE_SIZE_PAD_CLASS[size],
@@ -170,7 +170,7 @@ function tableRowClass({
170
170
  const visual = resolveVariantVisual(variant, KIT_TABLE_VARIANTS, "table.row");
171
171
  return cn(
172
172
  TABLE_ROW_BASE_CLASS,
173
- visual.className !== void 0 ? visual.className : TABLE_ROW_VARIANT_CLASS[visual.key],
173
+ skinVisualClass(visual, TABLE_ROW_VARIANT_CLASS[visual.key]),
174
174
  isSelectable && TABLE_ROW_SELECTABLE_CLASS,
175
175
  !isToned && (isSelected ? TABLE_ROW_SELECTED_CLASS : hoverVariant()),
176
176
  isSelectable && TABLE_ROW_FOCUS_CLASS,
@@ -191,7 +191,7 @@ function tableCellClass({
191
191
  const toneSurface = tone ? TABLE_ROW_TONE_SURFACE[tone] : void 0;
192
192
  return cn(
193
193
  TABLE_CELL_BASE_CLASS,
194
- visual.className !== void 0 ? visual.className : TABLE_CELL_VARIANT_CLASS[visual.key],
194
+ skinVisualClass(visual, TABLE_CELL_VARIANT_CLASS[visual.key]),
195
195
  TABLE_SIZE_TEXT_CLASS[size],
196
196
  TABLE_SIZE_PAD_CLASS[size],
197
197
  isToned && toneSurface,
@@ -5,7 +5,7 @@ import { mergeForwardedRef } from "../utils/mergeRefs.js";
5
5
  import { collectTabButtons, focusTabAt } from "./tabsA11y.js";
6
6
  import { useTabsListEnter } from "./tabsAnimations.js";
7
7
  import { TabsClassNamesProvider, useTabsContext, useTabsClassNames, useOptionalTabsMotionScope } from "./tabsContext.js";
8
- import { tabsIndicatorClass, tabsListClass } from "./tabsStyles.js";
8
+ import { tabsIndicatorShape, tabsIndicatorClass, tabsListClass } from "./tabsStyles.js";
9
9
  import { useSlidingTabIndicator } from "./useSlidingTabIndicator.js";
10
10
  import { useMotionPart } from "../utils/slotMotion/useMotionPart.js";
11
11
  const TabsList = forwardRef(function TabsList2({ className, classNames, children, onKeyDown, motion, ...rest }, ref) {
@@ -52,7 +52,7 @@ const TabsListSurface = forwardRef(
52
52
  indicatorPart.targetRef,
53
53
  value,
54
54
  orientation,
55
- variant,
55
+ tabsIndicatorShape(variant),
56
56
  tabElementsRef,
57
57
  layoutEpoch,
58
58
  scope
@@ -1,4 +1,4 @@
1
- import { TabsOrientation, TabsSize, TabsVariant } from './tabsTypes.js';
1
+ import { TabsOrientation, TabsSize, TabsVariant, KitTabsVariant } from './tabsTypes.js';
2
2
  export declare function tabsRootClass({ orientation, slotClass, className, }: {
3
3
  orientation: TabsOrientation;
4
4
  slotClass?: string;
@@ -10,6 +10,8 @@ export declare function tabsListClass({ orientation, variant, slotClass, classNa
10
10
  slotClass?: string;
11
11
  className?: string;
12
12
  }): string;
13
+ /** Kit base of a skin variant: `useSlidingTabIndicator` measures an underline or a pill by it. */
14
+ export declare function tabsIndicatorShape(variant: TabsVariant): KitTabsVariant;
13
15
  export declare function tabsIndicatorClass({ variant, slotClass, }: {
14
16
  variant: TabsVariant;
15
17
  slotClass?: string;
@@ -1,5 +1,5 @@
1
1
  import { TEXT_COLOR_TRANSITION } from "../utils/hoverVariant.js";
2
- import { resolveVariantVisual } from "../../../skins/resolveVariantVisual.js";
2
+ import { resolveVariantVisual, skinVisualClass } from "../../../skins/resolveVariantVisual.js";
3
3
  import { cn } from "../../../utils/cn.js";
4
4
  import { KIT_TABS_VARIANTS } from "./tabsTypes.js";
5
5
  import { CONTROL_SIZE_LAYOUT } from "../utils/sizeLayout/control.js";
@@ -51,11 +51,14 @@ function tabsListClass({
51
51
  "flex flex-col gap-xsmall",
52
52
  isSurface ? "items-start" : "items-stretch border-s-token"
53
53
  ),
54
- visual.className !== void 0 ? visual.className : LIST_VARIANT_CLASS[visual.key],
54
+ skinVisualClass(visual, LIST_VARIANT_CLASS[visual.key]),
55
55
  slotClass,
56
56
  className
57
57
  );
58
58
  }
59
+ function tabsIndicatorShape(variant) {
60
+ return resolveVariantVisual(variant, KIT_TABS_VARIANTS, "tabs.indicator").key;
61
+ }
59
62
  function tabsIndicatorClass({
60
63
  variant,
61
64
  slotClass
@@ -64,7 +67,7 @@ function tabsIndicatorClass({
64
67
  return cn(
65
68
  "pointer-events-none absolute z-0 motion-reduce:transition-none",
66
69
  visual.key === "default" ? "rounded-full" : tabsSurfaceRadiusClass(visual.key),
67
- visual.className !== void 0 ? visual.className : INDICATOR_VARIANT_CLASS[visual.key],
70
+ skinVisualClass(visual, INDICATOR_VARIANT_CLASS[visual.key]),
68
71
  slotClass
69
72
  );
70
73
  }
@@ -88,6 +91,7 @@ function tabsTabClass({
88
91
  isDisabled ? "cursor-not-allowed opacity-45" : "cursor-pointer",
89
92
  isSelected ? "text-primary" : "text-muted hover:text-primary",
90
93
  !isSelected && !isDisabled && TEXT_COLOR_TRANSITION,
94
+ skinVisualClass(visual),
91
95
  slotClass,
92
96
  className
93
97
  );
@@ -110,6 +114,7 @@ function tabsPanelClass({
110
114
  export {
111
115
  tabTextVariant,
112
116
  tabsIndicatorClass,
117
+ tabsIndicatorShape,
113
118
  tabsListClass,
114
119
  tabsPanelClass,
115
120
  tabsRootClass,
@@ -1,4 +1,4 @@
1
1
  import { RefObject } from 'react';
2
2
  import { MotionScopeValue } from '../utils/slotMotion/index.js';
3
- import { TabsOrientation, TabsVariant } from './tabsTypes.js';
4
- export declare function useSlidingTabIndicator(listRef: RefObject<HTMLElement | null>, indicatorRef: RefObject<HTMLElement | null>, activeValue: string | null, orientation: TabsOrientation, variant: TabsVariant, tabElementsRef: RefObject<Map<string, HTMLButtonElement>>, layoutEpoch: number, scope: MotionScopeValue | null): void;
3
+ import { KitTabsVariant, TabsOrientation } from './tabsTypes.js';
4
+ export declare function useSlidingTabIndicator(listRef: RefObject<HTMLElement | null>, indicatorRef: RefObject<HTMLElement | null>, activeValue: string | null, orientation: TabsOrientation, variant: KitTabsVariant, tabElementsRef: RefObject<Map<string, HTMLButtonElement>>, layoutEpoch: number, scope: MotionScopeValue | null): void;
@@ -2,7 +2,7 @@ import { FIELD_CONTROL_MOBILE_NO_ZOOM_CLASS } from "../utils/fieldControlMobileN
2
2
  import { resolveFieldShellSurfaceClass } from "../utils/fieldShellVariant.js";
3
3
  import { fieldShellHoverClass, FIELD_SHELL_TRANSITION_CLASS, fieldShellFocusRingClass } from "../utils/useFieldShellHoverLift.js";
4
4
  import { KIT_INPUT_VARIANTS } from "../Input/inputTypes.js";
5
- import { usesKitElevation, resolveVariantVisual } from "../../../skins/resolveVariantVisual.js";
5
+ import { usesKitElevation, resolveVariantVisual, skinVisualClass } from "../../../skins/resolveVariantVisual.js";
6
6
  import { cn } from "../../../utils/cn.js";
7
7
  import { CONTROL_SIZE_LAYOUT } from "../utils/sizeLayout/control.js";
8
8
  const TAGS_INPUT_ROOT_CLASS = "w-full min-w-0";
@@ -20,8 +20,7 @@ const TAG_TEXT = {
20
20
  };
21
21
  function tagsInputShellSurface(variant) {
22
22
  const visual = resolveVariantVisual(variant, KIT_INPUT_VARIANTS, "tagsInput.shell");
23
- if (visual.className !== void 0) return visual.className;
24
- return resolveFieldShellSurfaceClass({ variant });
23
+ return skinVisualClass(visual, resolveFieldShellSurfaceClass({ variant }));
25
24
  }
26
25
  function tagsInputShellClass({
27
26
  size,
@@ -49,6 +49,7 @@ function textareaShellClass({
49
49
  kitSurface && fieldShellHoverClass(!blocked, status, variant),
50
50
  shellHoverMotionClass,
51
51
  blocked ? "cursor-not-allowed opacity-55" : "",
52
+ visual.extend,
52
53
  slotClass,
53
54
  className
54
55
  );
@@ -78,6 +78,7 @@ function timeFieldShellClass({
78
78
  kitSurface && fieldShellHoverClass(!disabled, status, timeFieldShellHoverVariant(variant)),
79
79
  shellHoverMotionClass,
80
80
  disabled ? "cursor-not-allowed opacity-55" : "",
81
+ visual.extend,
81
82
  slotClass,
82
83
  className
83
84
  );
@@ -1,5 +1,5 @@
1
1
  import { messageBannerGridClass } from "../utils/messageBannerGridLayout.js";
2
- import { resolveVariantVisual } from "../../../skins/resolveVariantVisual.js";
2
+ import { resolveVariantVisual, skinVisualClass } from "../../../skins/resolveVariantVisual.js";
3
3
  import { cn } from "../../../utils/cn.js";
4
4
  import { KIT_TOAST_VARIANTS } from "./toastTypes.js";
5
5
  import { messageBannerSizePreset } from "../utils/sizeLayout/banner.js";
@@ -64,7 +64,7 @@ function toastRootClass({
64
64
  return cn(
65
65
  messageBannerGridClass(gridSlots, preset.gridGap),
66
66
  `w-full ${preset.shellPadding}`,
67
- visual.className !== void 0 ? visual.className : cn(TOAST_VARIANT_SURFACE[visual.key], liftClass),
67
+ skinVisualClass(visual, TOAST_VARIANT_SURFACE[visual.key], liftClass),
68
68
  slotClass,
69
69
  className
70
70
  );
@@ -111,6 +111,7 @@ function toggleButtonRootClass({
111
111
  kitSurface && !groupSegment && SHADOW_LIFT_MOTION_CLASS,
112
112
  !pressed && !disabled && hoverVariant(toggleButtonHoverVariant(visual.key)),
113
113
  TOGGLE_BUTTON_VARIANT_IDLE[visual.key],
114
+ visual.extend,
114
115
  pressed && TOGGLE_BUTTON_PRESSED_SURFACE_CLASS,
115
116
  disabled ? TOGGLE_BUTTON_DISABLED_CLASS : TOGGLE_BUTTON_ENABLED_CLASS,
116
117
  buttonRootClass(size, true),
@@ -1,6 +1,6 @@
1
1
  import { messageBannerIndicatorCellClass, messageBannerGridClass } from "../utils/messageBannerGridLayout.js";
2
2
  import { SEMANTIC_STATUS_TEXT } from "../utils/semanticStatusSurface.js";
3
- import { resolveVariantVisual } from "../../../skins/resolveVariantVisual.js";
3
+ import { resolveVariantVisual, skinVisualClass } from "../../../skins/resolveVariantVisual.js";
4
4
  import { cn } from "../../../utils/cn.js";
5
5
  import { TOOLTIP_ARROW_CLASS, TOOLTIP_ARROW_SHELL_PAD } from "./tooltipPosition.js";
6
6
  import { KIT_TOOLTIP_VARIANTS } from "./tooltipTypes.js";
@@ -92,7 +92,7 @@ function tooltipPanelClass({
92
92
  return cn(
93
93
  messageBannerGridClass(gridSlots, TOOLTIP_GRID_GAP[size]),
94
94
  TOOLTIP_PANEL_BASE_CLASS,
95
- visual.className !== void 0 ? visual.className : cn(TOOLTIP_PANEL_SHADOW_CLASS, TOOLTIP_VARIANT_SURFACE_CLASS[visual.key]),
95
+ skinVisualClass(visual, TOOLTIP_PANEL_SHADOW_CLASS, TOOLTIP_VARIANT_SURFACE_CLASS[visual.key]),
96
96
  TOOLTIP_TEXT_LAYOUT[size],
97
97
  slotClass,
98
98
  contentSlot,
@@ -108,7 +108,7 @@ function tooltipArrowClass({
108
108
  const visual = resolveVariantVisual(variant, KIT_TOOLTIP_VARIANTS, "tooltip.arrow");
109
109
  return cn(
110
110
  TOOLTIP_ARROW_BASE_CLASS,
111
- visual.className !== void 0 ? visual.className : TOOLTIP_ARROW_FILL_CLASS[visual.key],
111
+ skinVisualClass(visual, TOOLTIP_ARROW_FILL_CLASS[visual.key]),
112
112
  TOOLTIP_ARROW_CLASS[resolvedSide],
113
113
  slotClass,
114
114
  className
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { createContext, useContext, useRef, useMemo, useLayoutEffect } from "react";
4
+ import { studioSlotIds, applyStudioSlotMark } from "../../../../studio/studioModeContext.js";
4
5
  import { bindStudioController } from "../../../../studio/studioNodes.js";
5
6
  import gsap from "gsap";
6
7
  import { useMotionConfig } from "../motionConfigContext.js";
@@ -21,6 +22,7 @@ function createMotionScopeController({
21
22
  registry = createMotionRegistry()
22
23
  }) {
23
24
  const hostIds = /* @__PURE__ */ new Map();
25
+ const hostMarks = /* @__PURE__ */ new Map();
24
26
  const getSlots = () => splitMotionRootMap(getRootMotion()).slots;
25
27
  const getEvents = () => splitMotionRootMap(getRootMotion()).events;
26
28
  const getStates = () => splitMotionRootMap(getRootMotion()).states;
@@ -52,6 +54,8 @@ function createMotionScopeController({
52
54
  hostIds.set(slot, id);
53
55
  }
54
56
  register({ id, slot, node });
57
+ const ids = node ? studioSlotIds(scope.debugName, slot, void 0) : [];
58
+ hostMarks.set(slot, applyStudioSlotMark(hostMarks.get(slot) ?? null, node, ids, scope));
55
59
  };
56
60
  const resolve = (slot, phase, partMotion) => resolveSlotPhase(slot, phase, partMotion, getSlots(), getDefaults());
57
61
  const play = (slot, name, options) => {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { useRef, useCallback, useLayoutEffect, useMemo } from "react";
3
3
  import { shouldSkipInteractiveHoverLift } from "../hoverInteractiveLift.js";
4
- import { useStudioSlotCheck, studioSlotIds, applyStudioSlotMark } from "../../../../studio/studioModeContext.js";
4
+ import { useSkinSlotCheck, studioSlotIds, applyStudioSlotMark } from "../../../../studio/studioModeContext.js";
5
5
  import { mergeForwardedRef } from "../mergeRefs.js";
6
6
  import { useLazyRef } from "../useLazyRef.js";
7
7
  import { useMotionPointerPhases } from "./useMotionPointerPhases.js";
@@ -43,7 +43,7 @@ function useMotionPart({
43
43
  onPointerUp,
44
44
  studioSlot
45
45
  }) {
46
- const isLiveSlot = useStudioSlotCheck();
46
+ const isLiveSlot = useSkinSlotCheck();
47
47
  const targetRef = useRef(null);
48
48
  const motionRef = useRef(motion);
49
49
  motionRef.current = motion;
@@ -74,7 +74,7 @@ function useMotionPart({
74
74
  targetRef.current = node;
75
75
  syncRegistration(node, motionRef.current);
76
76
  if (forwardedRef != null) mergeForwardedRef(forwardedRef, node);
77
- const ids = node && isLiveSlot ? studioSlotIds(scope?.debugName, slot, studioSlot, isLiveSlot) : [];
77
+ const ids = node ? studioSlotIds(scope?.debugName, slot, studioSlot, isLiveSlot) : [];
78
78
  studioMarkRef.current = applyStudioSlotMark(studioMarkRef.current, node, ids, scope);
79
79
  },
80
80
  [forwardedRef, isLiveSlot, scope, slot, studioSlot, syncRegistration]
package/dist/internal.js CHANGED
@@ -15,7 +15,7 @@ import { playShadowFade, removeShadowFadeHost, snapShadowFade } from "./componen
15
15
  import { SHADOW_CSS_VAR, SHADOW_INTERACTION_GEOM, SHADOW_KNOB_CSS_DEFAULTS, SHADOW_LIFT_CSS_VAR, SHADOW_OPACITY_BASE } from "./tokens/shadows.js";
16
16
  import { SKIN_FORBIDDEN_TOKENS, isForbiddenSkinToken } from "./skins/skinTypes.js";
17
17
  import { applySkinVars, baselineFor, captureBaseline, isPaletteSkinToken, releaseSkinVars, resolveSkinTokens, skinSurfaceStyle } from "./skins/resolveSkinTokens.js";
18
- import { SKIN_DOCUMENT_SCHEMA, SKIN_EDITOR_EXAMPLE, parseSkinDocument, renderSkinPackage, skinExportName, skinToJson } from "./skins/skinDocument.js";
18
+ import { SKIN_DOCUMENT_SCHEMA, SKIN_EDITOR_EXAMPLE, parseSkinDocument, renderSkinPackage, renderSkinStylesheet, skinExportName, skinToJson } from "./skins/skinDocument.js";
19
19
  import { resolveAlertLiveRole } from "./components/core/Alert/alertA11y.js";
20
20
  import { resolveAlertStatus, resolveAlertVariant } from "./components/core/Alert/alertAPI.js";
21
21
  import { primaryButtonStatusForAlertTone, primaryButtonVariantForAlertTone } from "./components/composite/AlertDialog/alertDialogAPI.js";
@@ -46,7 +46,6 @@ import { applyBurneThemeConfig, applyCustomThemeTokens, applyTokens, clearCustom
46
46
  import { applyThemeMode } from "./theme/ThemeProvider.js";
47
47
  import { default as default2 } from "gsap";
48
48
  import { hasMotionRecipe, isKitMotionRecipe, listMotionRecipes, unregisterMotionRecipe } from "./components/core/utils/slotMotion/motionRecipeRegistry.js";
49
- import { renderSkinStylesheet } from "./cli/skin-stylesheet.js";
50
49
  import { shadowLayerCount } from "./cli/skin-color.js";
51
50
  import { useBurneThemeRuntime, useBurneThemeRuntimeOptional } from "./theme/themeRuntimeContext.js";
52
51
  export {
@@ -1,4 +1,5 @@
1
1
  import { MotionSlotMap } from '../components/core/utils/slotMotion/index.js';
2
+ import { ClassValue } from 'clsx';
2
3
  import { SkinSlot } from './skinTypes.js';
3
4
  export type ResolvedVariant<K extends string> = {
4
5
  /** Closed kit key. A skin name becomes `baseVariant`, an unknown string becomes `fallback`. */
@@ -33,6 +34,11 @@ export declare function resolveVariantVisual<K extends string>(variant: string,
33
34
  * The kit variant `default` keeps the kit classes; a skin may extend or replace them.
34
35
  */
35
36
  export declare function layoutTargetClass(slot: SkinSlot): string | undefined;
37
+ /**
38
+ * Slot surface classes: a string / `{ replace }` target swaps the kit classes,
39
+ * `{ extend }` lands after them.
40
+ */
41
+ export declare function skinVisualClass(visual: Pick<ResolvedVariant<string>, "className" | "extend">, ...kitClasses: ClassValue[]): string;
36
42
  /** Skin target for this slot, otherwise the kit class of the resolved key. */
37
43
  export declare function variantSlotClass<K extends string>(variant: string, kit: readonly K[], slot: SkinSlot, kitClass: (key: K) => string, fallback?: K): string;
38
44
  /**
@@ -1,3 +1,4 @@
1
+ import { cn } from "../utils/cn.js";
1
2
  import { lookupSkin } from "./skinLookup.js";
2
3
  const unknownVariantWarned = /* @__PURE__ */ new Set();
3
4
  function targetSpec(spec) {
@@ -24,7 +25,7 @@ function usesKitElevationMember(variant, kit, set) {
24
25
  return kit.includes(base) && set.has(base);
25
26
  }
26
27
  function resolveVariantVisual(variant, kit, slot, fallback) {
27
- const fb = fallback ?? "default";
28
+ const fb = "default";
28
29
  const fallbackKey = kit.includes(fb) ? fb : kit[0];
29
30
  if (isKitVariant(variant, kit)) {
30
31
  return { key: variant };
@@ -48,6 +49,10 @@ function layoutTargetClass(slot) {
48
49
  const visual = resolveVariantVisual("default", ["default"], slot);
49
50
  return visual.extend ?? visual.className;
50
51
  }
52
+ function skinVisualClass(visual, ...kitClasses) {
53
+ if (visual.className !== void 0) return visual.className;
54
+ return cn(...kitClasses, visual.extend);
55
+ }
51
56
  function overlaySkinMotion(defaults, variant, kit, prefix) {
52
57
  if (kit.includes(variant)) return defaults;
53
58
  const motion = lookupSkin(variant)?.motion;
@@ -71,6 +76,7 @@ export {
71
76
  layoutTargetClass,
72
77
  overlaySkinMotion,
73
78
  resolveVariantVisual,
79
+ skinVisualClass,
74
80
  usesKitElevation,
75
81
  usesKitElevationMember
76
82
  };
@@ -1,10 +1,14 @@
1
1
  import { parseCssColor, shadowLayerCount } from '../../cli/skin-color.mjs';
2
- import { renderSkinStylesheet } from '../../cli/skin-stylesheet.mjs';
3
2
  import { SkinDefinition } from './skinTypes.js';
4
- export { parseCssColor, renderSkinStylesheet, shadowLayerCount };
3
+ export { parseCssColor, shadowLayerCount };
5
4
  export type SkinDocument = Omit<SkinDefinition, "layers">;
6
5
  /** `paper` and `soft-paper`. Used as the npm package suffix. */
7
6
  export declare const SKIN_NAME_PATTERN: RegExp;
7
+ /**
8
+ * Token blocks, fonts, `@property`, and `rules`. A target rule matches its
9
+ * `.skin-{name}-{slot}` class; a part rule (`card.title`) matches `data-skin-slot`.
10
+ */
11
+ export declare function renderSkinStylesheet(skin: SkinDocument): string;
8
12
  export type SkinParseResult = {
9
13
  ok: true;
10
14
  skin: SkinDocument;
@@ -21,7 +25,10 @@ export declare function skinExportName(name: string): string;
21
25
  export declare const SKIN_PACKAGE_PEER = "^2.0.0";
22
26
  /** Class written for `rules[slot]`. Stable across export. */
23
27
  export declare function skinRuleClass(name: string, slot: string): string;
24
- /** Copy the generated rule class onto `targets` so the CSS matches a node. */
28
+ /**
29
+ * Copy the generated rule class onto `targets` so the CSS matches a node.
30
+ * Motion-only parts stay out of `targets`: their CSS matches `data-skin-slot`.
31
+ */
25
32
  export declare function bindSkinRuleClasses(skin: SkinDocument): SkinDocument;
26
33
  export type SkinPackageFileName = "package.json" | "README.md" | "LICENSE" | "tsconfig.json" | "tsconfig.build.json" | "src/index.ts" | "src/skin.json" | "src/skin.css";
27
34
  export type SkinPackageFiles = Record<SkinPackageFileName, string>;
@@ -2,11 +2,11 @@ import { MOTION_PHASE_NAMES } from "../components/core/utils/slotMotion/slotMoti
2
2
  import { checkContrastPairs, checkFocusRingContrast } from "../cli/skin-color.js";
3
3
  import { parseCssColor, shadowLayerCount } from "../cli/skin-color.js";
4
4
  import { skinMotionRecipeError } from "../cli/skin-recipe.js";
5
- import { renderSkinStylesheet } from "../cli/skin-stylesheet.js";
5
+ import { renderSkinStylesheet as renderSkinStylesheet$1 } from "../cli/skin-stylesheet.js";
6
6
  import { isAcceptedSkinSlot, skinSlotIssue } from "./skinSlotRegistry.js";
7
7
  import { isForbiddenSkinToken } from "./skinTypes.js";
8
- import { SKIN_SLOTS } from "./skinSlots.generated.js";
9
8
  import { SKIN_TARGET_SLOTS, SKIN_MOTION_SLOTS, SKIN_LAYER_SLOTS } from "./skinLiveSlots.generated.js";
9
+ import { SKIN_SLOTS } from "./skinSlots.generated.js";
10
10
  const DOCUMENT_KEYS = /* @__PURE__ */ new Set([
11
11
  "name",
12
12
  "extends",
@@ -80,6 +80,10 @@ const SLOTS = new Set(SKIN_SLOTS);
80
80
  const TARGET_SLOTS = new Set(SKIN_TARGET_SLOTS);
81
81
  const MOTION_SLOTS = new Set(SKIN_MOTION_SLOTS);
82
82
  const LAYER_SLOTS = new Set(SKIN_LAYER_SLOTS);
83
+ const RULE_SLOTS = /* @__PURE__ */ new Set([...SKIN_TARGET_SLOTS, ...SKIN_MOTION_SLOTS]);
84
+ function renderSkinStylesheet(skin) {
85
+ return renderSkinStylesheet$1(skin, { isTarget: (slot) => isAcceptedSkinSlot(slot, TARGET_SLOTS) });
86
+ }
83
87
  function slotError(label, slot, live) {
84
88
  const issue = skinSlotIssue(slot, SLOTS, live);
85
89
  if (issue === "empty") return `${label} slot is empty`;
@@ -205,7 +209,7 @@ function readDeclarations(value, label, errors) {
205
209
  }
206
210
  const style = {};
207
211
  for (const [key, item] of Object.entries(value)) {
208
- if (!/^(?:--)?[a-zA-Z_][\w-]*$/.test(key)) errors.push(`${label} property ${key} is not a CSS property`);
212
+ if (!/^(?:--|-(?:webkit|moz)-)?[a-zA-Z_][\w-]*$/.test(key)) errors.push(`${label} property ${key} is not a CSS property`);
209
213
  if (typeof item !== "string" || /[{};]/.test(item)) errors.push(`${label}.${key} has an unsafe value`);
210
214
  else style[key] = item;
211
215
  }
@@ -245,7 +249,7 @@ function readRules(value, errors) {
245
249
  }
246
250
  const rules = {};
247
251
  for (const [slot, spec] of Object.entries(value)) {
248
- const slotProblem = slotError("rules", slot, TARGET_SLOTS);
252
+ const slotProblem = slotError("rules", slot, RULE_SLOTS);
249
253
  if (slotProblem) errors.push(slotProblem);
250
254
  if (!isRecord(spec)) {
251
255
  errors.push(`rules.${slot} must be an object`);
@@ -278,7 +282,7 @@ function readRules(value, errors) {
278
282
  }
279
283
  next[branch] = map;
280
284
  }
281
- if (isAcceptedSkinSlot(slot, TARGET_SLOTS)) rules[slot] = next;
285
+ if (isAcceptedSkinSlot(slot, RULE_SLOTS)) rules[slot] = next;
282
286
  }
283
287
  return rules;
284
288
  }
@@ -481,6 +485,7 @@ function bindSkinRuleClasses(skin) {
481
485
  if (!skin.rules || Object.keys(skin.rules).length === 0) return skin;
482
486
  const targets = { ...skin.targets };
483
487
  for (const slot of Object.keys(skin.rules)) {
488
+ if (!isAcceptedSkinSlot(slot, TARGET_SLOTS)) continue;
484
489
  const extra = skinRuleClass(skin.name, slot);
485
490
  const current = targets[slot];
486
491
  if (current == null) targets[slot] = { extend: extra };
@@ -659,7 +664,7 @@ const SKIN_DOCUMENT_SCHEMA = {
659
664
  }
660
665
  ]
661
666
  }),
662
- rules: slotMapSchema(SKIN_TARGET_SLOTS, { type: "object" }),
667
+ rules: slotMapSchema([...SKIN_TARGET_SLOTS, ...SKIN_MOTION_SLOTS.filter((slot) => !TARGET_SLOTS.has(slot))], { type: "object" }),
663
668
  properties: { type: "object", additionalProperties: { type: "object" } },
664
669
  fonts: { type: "array", items: { type: "object" } },
665
670
  motion: {
@@ -11,6 +11,12 @@ type AuthorSkinSlot = keyof SkinSlotRegistry & string;
11
11
  export type SkinTargetSlot = KitSkinTargetSlot | AuthorSkinSlot;
12
12
  export type SkinMotionSlot = KitSkinMotionSlot | AuthorSkinSlot;
13
13
  export type SkinLayerSlot = KitSkinLayerSlot | AuthorSkinSlot;
14
+ /**
15
+ * `rules` key. A target slot gets the `.skin-{name}-{slot}` class through `targets`.
16
+ * A motion-only part (`card.title`, `button.text`) is matched by its `data-skin-slot`
17
+ * inside a node painted by the skin.
18
+ */
19
+ export type SkinRuleSlot = SkinTargetSlot | SkinMotionSlot;
14
20
  /**
15
21
  * Geometry of the focus ring. Color tokens are allowed: the validator requires
16
22
  * ≥3:1 against `background` and `surface`. Forced-colors still paints `Highlight`
@@ -139,10 +145,12 @@ export type SkinDefinition = {
139
145
  /** Ярус 2 classes. Only slots `resolveVariantVisual` actually reads. */
140
146
  targets?: Partial<Record<SkinTargetSlot, SkinTargetSpec>>;
141
147
  /**
142
- * Ярус 2 CSS properties. Export writes a class `.skin-{name}-{slot}` and appends
143
- * it to `targets`, so the rule works without Tailwind.
148
+ * Ярус 2 CSS properties. For a target slot export writes a class `.skin-{name}-{slot}`
149
+ * and appends it to `targets`, so the rule works without Tailwind. A motion-only part
150
+ * (`card.title`) is matched by `[data-skin-slot~="card.title"]` under
151
+ * `[data-variant="{name}"]` or `[data-skin="{name}"]`.
144
152
  */
145
- rules?: Partial<Record<SkinTargetSlot, SkinSlotRules>>;
153
+ rules?: Partial<Record<SkinRuleSlot, SkinSlotRules>>;
146
154
  /** `@property` declarations for variables this skin animates. */
147
155
  properties?: Record<string, SkinPropertyDefinition>;
148
156
  /** Fonts loaded with the skin stylesheet. */
@@ -1,6 +1,5 @@
1
1
  import { SKIN_CONTRAST_PAIRS, parseCssColor, contrastRatio, AA_CONTRAST } from "../cli/skin-color.js";
2
- import { renderSkinStylesheet } from "../cli/skin-stylesheet.js";
3
- import { SKIN_NAME_PATTERN, parseSkinDocument, bindSkinRuleClasses } from "../skins/skinDocument.js";
2
+ import { SKIN_NAME_PATTERN, parseSkinDocument, renderSkinStylesheet, bindSkinRuleClasses } from "../skins/skinDocument.js";
4
3
  import { createDefaultThemeState, exportThemeCss, COLOR_CSS_VAR, motionConfigFromThemeState } from "../theme/themeDefaults.js";
5
4
  import { THEME_TOKEN_SCHEMA } from "./themeTokenSchema.js";
6
5
  const DESIGN_DOCUMENT_VERSION = 1;
@@ -0,0 +1,2 @@
1
+ /** A slot the kit renders and a skin can paint. */
2
+ export declare function isLiveSkinSlot(id: string): boolean;
@@ -0,0 +1,8 @@
1
+ import { SKIN_TARGET_SLOTS, SKIN_LAYER_SLOTS, SKIN_MOTION_SLOTS } from "../skins/skinLiveSlots.generated.js";
2
+ const LIVE_SKIN_SLOTS = /* @__PURE__ */ new Set([...SKIN_TARGET_SLOTS, ...SKIN_LAYER_SLOTS, ...SKIN_MOTION_SLOTS]);
3
+ function isLiveSkinSlot(id) {
4
+ return LIVE_SKIN_SLOTS.has(id);
5
+ }
6
+ export {
7
+ isLiveSkinSlot
8
+ };