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.
- package/cli/skin-build.mjs +4 -2
- package/cli/skin-stylesheet.d.mts +9 -6
- package/cli/skin-stylesheet.mjs +20 -4
- package/dist/cli/skin-stylesheet.js +11 -4
- package/dist/components/composite/AlertDialog/alertDialogStyles.js +2 -2
- package/dist/components/composite/ButtonGroup/buttonGroupStyles.js +5 -2
- package/dist/components/core/Alert/alertStyles.js +2 -3
- package/dist/components/core/Avatar/avatarStyles.js +2 -2
- package/dist/components/core/Badge/badgeStyles.js +5 -4
- package/dist/components/core/Button/buttonStyles.js +3 -5
- package/dist/components/core/Calendar/calendarStyles.js +2 -2
- package/dist/components/core/Card/cardStyles.js +1 -0
- package/dist/components/core/CloseButton/closeButtonStyles.js +1 -0
- package/dist/components/core/ComboBox/comboBoxStyles.js +2 -3
- package/dist/components/core/DatePicker/datePickerParts.js +7 -0
- package/dist/components/core/DatePicker/datePickerStyles.js +2 -3
- package/dist/components/core/Dialog/dialogStyles.js +2 -2
- package/dist/components/core/Disclosure/disclosureStyles.js +5 -3
- package/dist/components/core/Drawer/drawerStyles.js +2 -2
- package/dist/components/core/Dropdown/dropdownStyles.js +2 -2
- package/dist/components/core/Expandable/expandableStyles.js +2 -2
- package/dist/components/core/Field/fieldParts.d.ts +1 -1
- package/dist/components/core/Input/inputStyles.js +2 -3
- package/dist/components/core/Kbd/kbdStyles.js +2 -3
- package/dist/components/core/ListBox/listBoxStyles.js +2 -2
- package/dist/components/core/NumberInput/numberInputStyles.js +2 -3
- package/dist/components/core/PinInput/pinInputStyles.js +2 -3
- package/dist/components/core/Popover/popoverStyles.js +3 -3
- package/dist/components/core/SearchInput/searchInputStyles.js +1 -0
- package/dist/components/core/Select/selectStyles.js +2 -3
- package/dist/components/core/SelectionIndicator/selectionIndicatorStyles.js +6 -13
- package/dist/components/core/SelectionThumb/selectionThumbStyles.js +3 -4
- package/dist/components/core/Slider/sliderStyles.js +3 -2
- package/dist/components/core/Surface/surfaceStyles.js +2 -3
- package/dist/components/core/Switch/switchStyles.js +3 -4
- package/dist/components/core/Table/tableStyles.js +6 -6
- package/dist/components/core/Tabs/tabsParts.js +2 -2
- package/dist/components/core/Tabs/tabsStyles.d.ts +3 -1
- package/dist/components/core/Tabs/tabsStyles.js +8 -3
- package/dist/components/core/Tabs/useSlidingTabIndicator.d.ts +2 -2
- package/dist/components/core/TagsInput/tagsInputStyles.js +2 -3
- package/dist/components/core/TextArea/textAreaStyles.js +1 -0
- package/dist/components/core/TimeField/timeFieldStyles.js +1 -0
- package/dist/components/core/Toast/toastStyles.js +2 -2
- package/dist/components/core/ToggleButton/toggleButtonStyles.js +1 -0
- package/dist/components/core/Tooltip/tooltipStyles.js +3 -3
- package/dist/components/core/utils/slotMotion/createMotionScope.js +4 -0
- package/dist/components/core/utils/slotMotion/useMotionPart.js +3 -3
- package/dist/internal.js +1 -2
- package/dist/skins/resolveVariantVisual.d.ts +6 -0
- package/dist/skins/resolveVariantVisual.js +7 -1
- package/dist/skins/skinDocument.d.ts +10 -3
- package/dist/skins/skinDocument.js +11 -6
- package/dist/skins/skinTypes.d.ts +11 -3
- package/dist/studio/designDocument.js +1 -2
- package/dist/studio/liveSkinSlots.d.ts +2 -0
- package/dist/studio/liveSkinSlots.js +8 -0
- package/dist/studio/studioMode.d.ts +4 -4
- package/dist/studio/studioMode.js +3 -17
- package/dist/studio/studioModeContext.d.ts +4 -2
- package/dist/studio/studioModeContext.js +7 -6
- package/dist/studio.d.ts +3 -2
- package/dist/studio.js +3 -3
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Studio canvas root. Kit parts carry `data-skin-slot` everywhere; inside this
|
|
4
|
+
* provider marks narrow to live skin slots and `useStudioMode()` is true.
|
|
5
|
+
*/
|
|
5
6
|
export declare function StudioModeProvider({ children }: {
|
|
6
7
|
children: ReactNode;
|
|
7
8
|
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export declare function isLiveSkinSlot(id: string): boolean;
|
|
@@ -1,24 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import { SKIN_TARGET_SLOTS, SKIN_LAYER_SLOTS, SKIN_MOTION_SLOTS } from "../skins/skinLiveSlots.generated.js";
|
|
3
|
+
import { isLiveSkinSlot } from "./liveSkinSlots.js";
|
|
5
4
|
import { StudioSlotProvider } from "./studioModeContext.js";
|
|
6
|
-
import { skinSlotId, useStudioMode } from "./studioModeContext.js";
|
|
7
|
-
const LIVE_SKIN_SLOTS = /* @__PURE__ */ new Set([
|
|
8
|
-
...SKIN_TARGET_SLOTS,
|
|
9
|
-
...SKIN_LAYER_SLOTS,
|
|
10
|
-
...SKIN_MOTION_SLOTS
|
|
11
|
-
]);
|
|
12
5
|
function StudioModeProvider({ children }) {
|
|
13
|
-
|
|
14
|
-
return /* @__PURE__ */ jsx(StudioSlotProvider, { isLive, children });
|
|
15
|
-
}
|
|
16
|
-
function isLiveSkinSlot(id) {
|
|
17
|
-
return LIVE_SKIN_SLOTS.has(id);
|
|
6
|
+
return /* @__PURE__ */ jsx(StudioSlotProvider, { isLive: isLiveSkinSlot, children });
|
|
18
7
|
}
|
|
19
8
|
export {
|
|
20
|
-
StudioModeProvider
|
|
21
|
-
isLiveSkinSlot,
|
|
22
|
-
skinSlotId,
|
|
23
|
-
useStudioMode
|
|
9
|
+
StudioModeProvider
|
|
24
10
|
};
|
|
@@ -6,6 +6,8 @@ export declare function StudioSlotProvider({ isLive, children, }: {
|
|
|
6
6
|
}): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export declare function useStudioMode(): boolean;
|
|
8
8
|
export declare function useStudioSlotCheck(): StudioSlotCheck | null;
|
|
9
|
+
/** The studio narrows marks to live skin slots. */
|
|
10
|
+
export declare function useSkinSlotCheck(): StudioSlotCheck;
|
|
9
11
|
/** `Button` + `root` → `button.root`, matching the live skin slot list. */
|
|
10
12
|
export declare function skinSlotId(debugName: string, slot: string): string;
|
|
11
13
|
export type StudioSlotMark = {
|
|
@@ -19,10 +21,10 @@ export type StudioSlotMark = {
|
|
|
19
21
|
*/
|
|
20
22
|
export declare function applyStudioSlotMark(previous: StudioSlotMark | null, node: HTMLElement | null, ids: readonly string[], scope: object | null): StudioSlotMark | null;
|
|
21
23
|
/** Motion id plus an extra target id, when both are in the live set. */
|
|
22
|
-
export declare function studioSlotIds(debugName: string | undefined, slot: string, studioSlot: string | undefined, isLive
|
|
24
|
+
export declare function studioSlotIds(debugName: string | undefined, slot: string, studioSlot: string | undefined, isLive?: StudioSlotCheck): string[];
|
|
23
25
|
/**
|
|
24
26
|
* Marks a node whose motion slot id is not the skin target id
|
|
25
|
-
* (`alertDialog.panel`, `disclosure.trigger`, …).
|
|
27
|
+
* (`alertDialog.panel`, `disclosure.trigger`, …).
|
|
26
28
|
* Binding runs in the ref callback, so a swapped node (`asChild`) is marked and the previous one is cleared.
|
|
27
29
|
*/
|
|
28
30
|
export declare function useStudioSlotRef<T extends HTMLElement>(slotId: string, scope?: object | null): (node: T | null) => void;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useContext, createContext, useRef, useCallback } from "react";
|
|
4
4
|
import { bindStudioNode, unbindStudioNode } from "./studioNodes.js";
|
|
5
|
+
const anySkinSlot = () => true;
|
|
5
6
|
const StudioModeContext = createContext(null);
|
|
6
7
|
function StudioSlotProvider({
|
|
7
8
|
isLive,
|
|
@@ -12,8 +13,8 @@ function StudioSlotProvider({
|
|
|
12
13
|
function useStudioMode() {
|
|
13
14
|
return useContext(StudioModeContext) !== null;
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
-
return useContext(StudioModeContext);
|
|
16
|
+
function useSkinSlotCheck() {
|
|
17
|
+
return useContext(StudioModeContext) ?? anySkinSlot;
|
|
17
18
|
}
|
|
18
19
|
function skinSlotId(debugName, slot) {
|
|
19
20
|
return `${debugName.slice(0, 1).toLowerCase()}${debugName.slice(1)}.${slot}`;
|
|
@@ -49,7 +50,7 @@ function applyStudioSlotMark(previous, node, ids, scope) {
|
|
|
49
50
|
if (scope) bindStudioNode(node, scope);
|
|
50
51
|
return { node, ids: [...ids], scope };
|
|
51
52
|
}
|
|
52
|
-
function studioSlotIds(debugName, slot, studioSlot, isLive) {
|
|
53
|
+
function studioSlotIds(debugName, slot, studioSlot, isLive = anySkinSlot) {
|
|
53
54
|
const ids = [];
|
|
54
55
|
if (debugName) {
|
|
55
56
|
const motionId = skinSlotId(debugName, slot);
|
|
@@ -59,10 +60,10 @@ function studioSlotIds(debugName, slot, studioSlot, isLive) {
|
|
|
59
60
|
return ids;
|
|
60
61
|
}
|
|
61
62
|
function useStudioSlotRef(slotId, scope) {
|
|
62
|
-
const isLive =
|
|
63
|
+
const isLive = useSkinSlotCheck();
|
|
63
64
|
const markRef = useRef(null);
|
|
64
65
|
return useCallback((node) => {
|
|
65
|
-
const ids = node && isLive
|
|
66
|
+
const ids = node && isLive(slotId) ? [slotId] : [];
|
|
66
67
|
markRef.current = applyStudioSlotMark(markRef.current, node, ids, scope ?? null);
|
|
67
68
|
}, [isLive, scope, slotId]);
|
|
68
69
|
}
|
|
@@ -71,7 +72,7 @@ export {
|
|
|
71
72
|
applyStudioSlotMark,
|
|
72
73
|
skinSlotId,
|
|
73
74
|
studioSlotIds,
|
|
75
|
+
useSkinSlotCheck,
|
|
74
76
|
useStudioMode,
|
|
75
|
-
useStudioSlotCheck,
|
|
76
77
|
useStudioSlotRef
|
|
77
78
|
};
|
package/dist/studio.d.ts
CHANGED
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export { DESIGN_DOCUMENT_SCHEMA, DESIGN_DOCUMENT_VERSION, contrastRatio, designThemeToState, parseCssColor, parseDesignDocument, renderDesignCss, validateDesign, type DesignDocument, type DesignMeta, type DesignParseResult, type DesignTheme, type DesignValidation, } from './studio/designDocument.js';
|
|
9
9
|
export { THEME_TOKEN_SCHEMA, themeTokenSchemaEntry, type ThemeTokenControlType, type ThemeTokenSchemaEntry, } from './studio/themeTokenSchema.js';
|
|
10
|
-
export { isLiveSkinSlot
|
|
11
|
-
export {
|
|
10
|
+
export { isLiveSkinSlot } from './studio/liveSkinSlots.js';
|
|
11
|
+
export { StudioModeProvider } from './studio/studioMode.js';
|
|
12
|
+
export { skinSlotId, useStudioMode, useStudioSlotRef } from './studio/studioModeContext.js';
|
|
12
13
|
export { findMotionController } from './studio/studioNodes.js';
|
|
13
14
|
export { forceStateAttribute, FORCE_STATE_TOKENS, playForceStateMotion, type ForceStateToken, } from './studio/forceState.js';
|
|
14
15
|
export { paletteFromBrand } from './studio/paletteFromBrand.js';
|
package/dist/studio.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DESIGN_DOCUMENT_SCHEMA, DESIGN_DOCUMENT_VERSION, designThemeToState, designToSkin, parseDesignDocument, renderDesignCss, validateDesign } from "./studio/designDocument.js";
|
|
2
2
|
import { THEME_TOKEN_SCHEMA, themeTokenSchemaEntry } from "./studio/themeTokenSchema.js";
|
|
3
|
-
import {
|
|
3
|
+
import { isLiveSkinSlot } from "./studio/liveSkinSlots.js";
|
|
4
|
+
import { StudioModeProvider } from "./studio/studioMode.js";
|
|
4
5
|
import { skinSlotId, useStudioMode, useStudioSlotRef } from "./studio/studioModeContext.js";
|
|
5
6
|
import { findMotionController } from "./studio/studioNodes.js";
|
|
6
7
|
import { FORCE_STATE_TOKENS, forceStateAttribute, playForceStateMotion } from "./studio/forceState.js";
|
|
@@ -13,10 +14,9 @@ import { applyThemeTokens, clearThemeInlineTokens, createDefaultThemeState, expo
|
|
|
13
14
|
import { resolveThemeTokenState, themeTokenStateToConfig } from "./theme/themeConfig.js";
|
|
14
15
|
import { KIT_MOTION_RECIPE_META } from "./components/core/utils/slotMotion/kitMotionRecipeMeta.js";
|
|
15
16
|
import { SKIN_LAYER_SLOTS, SKIN_MOTION_SLOTS, SKIN_TARGET_SLOTS } from "./skins/skinLiveSlots.generated.js";
|
|
16
|
-
import { bindSkinRuleClasses, formatSkinPackage, parseSkinDocument, renderSkinPackage } from "./skins/skinDocument.js";
|
|
17
|
+
import { bindSkinRuleClasses, formatSkinPackage, parseSkinDocument, renderSkinPackage, renderSkinStylesheet } from "./skins/skinDocument.js";
|
|
17
18
|
import { DARK_COLORS, LIGHT_COLORS } from "./theme/themePalettes.js";
|
|
18
19
|
import { contrastRatio, parseCssColor } from "./cli/skin-color.js";
|
|
19
|
-
import { renderSkinStylesheet } from "./cli/skin-stylesheet.js";
|
|
20
20
|
export {
|
|
21
21
|
AMBER_DARK_COLORS,
|
|
22
22
|
AMBER_LIGHT_COLORS,
|